- Home /
Respawn for Enemys
in my game i whant the enemy i killed to respawn after a certan time at the same place he start the game.how can i make this ??
Answer by joedrigon · Oct 25, 2010 at 02:02 AM
You could add a variable in Update() that will start a timer if enemy dead flag is set to true and after a certain amount of time respawn him/her =)...
This isn't complete code or anything but maybe this will give you a better idea... of what I'm rambling about.
Update() {
if(isDead) {
isDeadTime = Time.time;
}
if(isDeadTime > 3.0f) {
isDead = false;
SpawnEnemy();
}
}
SomeOtherFunction() {
isDead = true;
isDeadTime = 0.0f;
}
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
How can I create New GameObject (Instantiate) 1 Answer
C# Respawn Help 1 Answer
Respawn question unanswered 0 Answers
how to spawn and destroy 2 Answers