AI "tilting" when approaching new nodes in the path


I am having a strange issue with my AI.

I am using a LocalSpaceRichAI graph, so that I can have the platform that the AI is standing on rotate to an arbitrary y-up angle. I am doing this because my game takes place on realistic, spherical, planets, and cities, etc, may be located anywhere on the planet.

This works fine, however, when the AI approaches what seems to be new nodes on the path, they tilt to an odd angle briefly, before they pass the node and continue on normally.

The AI works fine, it’s just this strange rotation issue that I can’t seem to fix.

This image shows the issue:

The AI is clearly tilted as it has reached the node in the path.

This image:

Shows the AI just after the previous image was taken, you can see the rotation is now correct. You can also see the “node” in the image above, it seems to be a vertical grey line? This is where the rotation issue occurs.

I have used the same A* pathfinding system elsewhere in my project (on moving platforms) and it works fine, and in the latter case, I can’t see the grey vertical lines.

Can anyone shed any light as to what might be happening here?

Or where to begin looking to fix this?


Are you sure you don’t mean the AIPathAlignedToSurface script? I’m not sure how the LocalSpaceRichAI script could cause this.

I’m not sure what is actually causing it, but I am using the localspacerichai graph.

It seems to occur even when I disable everything else in my scene except for the A* system (so there’s not other AI or gravity code, etc, running), so I’m guessing it’s coming from the A* system somewhere?

I just have a localspacerichai script, a “seeker” script, and an aidestination setter script on my ai.