Rotation in 2D (z-axis) bug in AIPath.cs with version 4.1.7

Hey,
I recently upgraded my A* Pathfinding Project to the newest beta version 4.1.7.
Now my AIPath game object don’t rotate only on z-axis anymore although I have the rotationIn2D checked. I didn’t change the rotation of any game object so I have no idea why it’s not working anymore.

Starting (Doesn’t follow path):

Following Path:
Before starting to follow the path, the GameObject acts perfectly fine. After starting to find the Target the GameObject starts also rotating on the x and y-axis even though RotationIn2D being true. When deactivating RotationIn2D the behaviour doesn’t change.

Edit:
Tried the 2D test scene that comes along with the project with the AIPath script instead of the AILerp script.
Result is the same buggy 2D rotation. (But the scene works fine with AILerp)
AI Object scripts

When someone knows how to fix this that would be pretty great! Need to present the project in 2 days.
Otherwise I think would have to change my Pathfinding from AIPath to AILerp.

Hi

It seems I manged to flip the target Z axis of the AIPath script at some point in the betas. I think in your version it will try to rotate itself so that the Z axis of the object points in the world’s -Z direction instead of in the +Z direction. I have uploaded beta 4.1.8 which fixes this (among other things).

1 Like

Thank you so much for this quick fix! :slight_smile: