Another question here. I have been looking for a solution for something like when i kill the enemies in a level, a door will open or something like that will be triggered. Not much discussion went through the community about this topic except i found just one. Here is the glimpse what was tried...
//Add the number of enemies already in the Level
static var enemyCount : int = 0;
function Update ()
{
if(enemyCount < 1)
{
//Instantiate prize and open door
print("Ok Now Open The Door!");
}
if(enemyCount > 0)
{
print("The Enemy Count is" + "" + enemyCount);
}
}
I was wondering if anybody can help on it or already have a better way to do it. Even any link that is describing this matter is also appreciated as well.
Thank you.
↧