Move only on the grid (without cutting corners)?

I’m trying to make the AI move only along the center of my tiles; however I still see it ‘cut’ to go with the shortest path.

I just have the simple scripts in here and AStar is set to GridGraph with 4 connections.

What am I missing here ?

Thank you for any help !

Hi

You probably want to use the AILerp script instead of the AIPath script. See the comparison here: https://arongranberg.com/astar/docs/movementscripts.html

You might want to change the Seeker->StartEndModifier settings, see the description here: https://arongranberg.com/astar/docs/ailerp.html

1 Like

Worked flawlesly ! Thanks !

One last question: Is it possible to give anything other than a ‘transform’ to set the destination ?
https://arongranberg.com/astar/docs/wander.html
I believe the wander example is not for 4.2+ examples; and i don’t want to spawn a gameobject just to set a transform. Any idea on doing this (still using Lerp) ?

Thanks !

You can remove the AIDestinationSetter component and just set the ai.destination property directly.
See https://arongranberg.com/astar/docs/iastarai.html#destination

So obvious. Gosh I need coffee ! Thanks !