|
Hello, I am developing an AI system. Currently, I am doing this: transform.position = Vector3.MoveTowards(transform.position, player.position, moveSpeed * Time.deltaTime); Works great, until the player goes at a higher point then the enemy... How can I make it so that the enemy does not fly upwards towards the player? THANKS
(comments are locked)
|
|
You could also use Mathf.Clamp or a static '1' on the Y axis , in the above example, var newPos = "move towards".
(comments are locked)
|
|
If you take a look at this function you may get something to proceed further!?!?! http://unity3d.com/support/documentation/ScriptReference/Terrain.SampleHeight.html Naah, that won't work. Thanks though.
Dec 28 '11 at 04:54 PM
tatelax
(comments are locked)
|
