2D wander AI only moves sideways - help!

Hi there! I made a 2D wander AI using the ‘wandering AI tutorial’ guide on the official site. I’m starting out basic, just trying to get my butterfly to move around the map randomly. However, for some reason whenever the camera moves away from the butterfly, the butterfly can only move between the last two points that were set, even if I move the camera back again. Any idea how to fix this?

Here is a video demonstrating the issue:
https://streamable.com/5lzzev

And my settings and code:


Thank you so much in advance!

Hi

This is due to the agent recalculating its path and wanting to move back to a node which is behind it in some sense. I see that you have set Seeker → Start End Modifier → Add Points to true. You may want to disable that. I think that’s the cause here.

Hi! Thanks for the quick reply. Unfortunately, disabling Add Points makes it worse. The butterfly more quickly gets locked into the horizontal back and forth. Very strange. Do you think it might have something to do with the code picking random points in a sphere instead of a circle, since it is a 2D game? I wasn’t sure how to modify the sample code for a 2D setting.

I don’t think it has anything to do with that.
Are you using a grid graph or a point graph?

I’m using a grid graph. But the butterfly is the default traversible grid ‘Everything.’