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 !


You probably want to use the AILerp script instead of the AIPath script. See the comparison here:

You might want to change the Seeker->StartEndModifier settings, see the description here:

1 Like

Worked flawlesly ! Thanks !

One last question: Is it possible to give anything other than a ‘transform’ to set the destination ?
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.

So obvious. Gosh I need coffee ! Thanks !