Quantcast
Channel: Questions in topic: "enemy"
Viewing all articles
Browse latest Browse all 1488

Disable a target after trigger exit?

$
0
0
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"){ //??? } }

Viewing all articles
Browse latest Browse all 1488

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>