FragMate CommunityLog in

FragMate - Software and Game Developer Community, including Resources, Forums, Marketplace & More.

Share

descriptionEnemy Count

more_horiz
This script will change the level after a specified Gameobject(s) are destroyed.

DIRECTIONS:



  • Copy and paste the following script into a Javascript. Name script Enemy Count
  • Tag the Gameobject(s) you want destroyed with the tag Enemy-you can change this but don't forget to change it it the script!
  • Next drag the Enemy Count script onto the Player Gameobject.
  • Next add the specified level ExampleGame-the name can be changed but don't forget to change it in the script-to the build settings. ¬†File -> Build settings -> Add current. This will add the current scene into the build settings.
  • ENJOY!

Code:

//SCRIPT DEVELOPED BY ONEKNIFEGAMES DO NOT REMOVE!

#pragma strict

var level:int;

function Start () {

}

function Update () { print(GameObject.FindGameObjectsWithTag("Enemy").Length);

if(GameObject.FindGameObjectsWithTag("Enemy").Length==0) {Application.LoadLevel("ExampleGame");}

}

//SCRIPT DEVELOPED BY ONEKNIFEGAMES DO NOT REMOVE!

_________________
-One Knife Games

descriptionRe: Enemy Count

more_horiz
Great share OneKnife!
Permissions in this forum:
You cannot reply to topics in this forum