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 ??
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;
}