- Home /
Enemy and hero. Distance
I need to make that when my hero come to enemy, enemy come to me.
This code i write to see distance between me and enemy:
if(Vector3.Distance(player.transform.position,enemy.transform.position)<10)
How make that enemy come to me? (player = GameObject.Find("_Player"); enemy = GameObject.Find("Cube")).
Answer by StasSidletsky · Aug 01, 2012 at 09:12 PM
You don't know?!?
This is not an answer, and you need to be more clear in your question to receive good answers.
Post your whole script and perhaps we can see how far into the logic you are and offer help, but we can't without seeing more, or understanding your problem better.
Your answer
Follow this Question
Related Questions
Stay Back! 2 Answers
Player lives script 1 Answer
Player damage stops working over time 0 Answers
A node in a childnode? 1 Answer
crossdomain.xml Unity 3.0 0 Answers