Prevent Agent from Cutting Corners on 2D Map

Hello!

The agent is a Car where it has to adhere to the roads of a city, that the movement by default will cut corners causes it to go over buildings making it look sloppy, was wondering if anyone could help or give advice for a custom movement script that will:

  • force the agent to travel from node to node in the path in order
  • allow for agent to turn corners and always be forward facing in direction (Y-axis forward)

Path does not need to be recalculated until the destination is reached

Any help is appreciated, thank you!


for aipath with aidestination target (no modifers) to move from node to node- make in seeker settings -node center
to face movement- enable rotation

ai lerp works the same i think

for not checking each frame set max interval high or none instead of dynamic

corners
to not cut corners uncheck in pathfinder settings

maybe something will be helpful for you

this is specifically for a point graph which doesnt have that option unfortunately under Graphs settings, will try the other things tho thank you!

Hi

Sorry for the late answer.
If you use the AIPath script, you can reduce the amount of corner cutting it does by reducing the pick next waypoint distance field. You can alternatively use the AILerp script together with a SimpleSmoothModifier which may allow you more control over the corner cutting (but it depends on your game, if you want that kind of movement).