- Home /
Click to move Diablo Style
Hello everyone. I'm trying to implement a 'Click to Move' to a capsule. Is there any script for this particular type of movement? As the style of Diablo
Answer by Bravini · Nov 20, 2010 at 12:39 PM
you can find the script you seek (and much, much more) on Unity Wiki http://www.unifycommunity.com/wiki/index.php?title=Scripts
Answer by denewbie · Nov 20, 2010 at 11:35 AM
1) first you use ray casting to detect the Hit point of the terrain.
2) Then you use a transform.LookAt(); to face the player in the right direction;
3) then you do a transform.Translate(Vector3.forward); to move towards the point.
You have to make sure the Y- is correct other wise you ll keep walking into the ground.
Answer by diabloroxx · Nov 20, 2010 at 12:22 PM
Check the "Moving on Uneven Terrain" at the ITween website. You can use his documentation for using the library. http://www.pixelplacement.com/itween/examples.php