So I’m making a very simple zombie AI were if a player gets close enough it sets the player as its target it follows but I dont want it to follow the player for ever, I want it to stop follow the player when he exit the trigger, how can I do that?
Some Code:
var Target : Transform;
function OnTriggerEnter(other : Collider){
if(other.gameObject.tag == "Player"){
Target = other.gameObject.transform;
}
}
function OnTriggerExit(other : Collider){
if(other.gameObject.tag == "Player"){
//???
}
}