Hello,
I would like to know if anyone knows how to achieve a click to move movement restricted to 8 axis.
I’m trying to do this to achieve a more old school rpg look to my game.
I’m currently using NavMeshAgent to do the movement, pretty straight forward, but don’t know how to achieve the result I want now.
Any ideas??
Thank you!
Click to move seems to be simple when you only need to move to destination, but gets harder when you click on enemy and player should approach enemy first and then only attack.
https://docs.unity3d.com/Manual/nav-MoveToClickPoint.html
Physics.Raycast ‘sends’ ray to clicked point by mouse, but not sure how that works when a few gameobjects are “caught” by same ray (there is “foreach (RaycastHit hit in hits)” solution)
you can try my RPG project, it has click-tomove more or less done:
https://github.com/ivandonetsunity3d/Kshatriya3d
(not sure about 8 axis, though)