Hello - I need one npc to walk forward, and after 13 seconds, to disappear and another npc to be set to active in the same position.
This is my script, but although the first npc is destroyed, the second one is instantiated at 0,0,0.
What am I doing wrong?
var zombie : GameObject;
var exoGrey : GameObject;
var characterPosition : Vector3;
function Start () {
zombie.SetActive (false);
exoGrey.SetActive (false);
}
function OnTriggerEnter () {
zombie.SetActive (true);
yield WaitForSeconds (13);
zombie.SetActive (false);
zombie.transform.position = characterPosition;
exoGrey.transform.position = characterPosition;
exoGrey.SetActive (true);
}
Thanks, Laurien