FollowerEntity pathfinding is behaving very inconsistently for us. Most of the time it works fine, but there’s seemingly random times (i’d say about 5-10% of the time?) when the agent suddenly does a little twirl on the spot. It happens mostly on corners (as seen in the gif) but sometimes also on when it’s moving in a straight line.
We’re using a Grid Graph, which is static when these agents start moving about. Their destination is assigned once and doesn’t change until the agent has made it to its destination, there’s no local avoidance either so it’s fair to assume that it calculates a path and then stays on that path until it makes it there.
Things I’ve tried so far:
Messing with FollowerEntity radius, desiredwalldistance, stop distance, lead in radius, allow rotating on the spot, wall distance.
And on the grid graph: Cut Corners on/off, Changing the Collision testing Diameter.
The only thing that gave a noticeable improvement in the pathfinding was settings the thread count to “automatic high load”. That reduced the stuttering at least. Anyone got any ideas?
Here’s a video with the Movement Debug Rendering set to Path.I tried reproducing this with only 1 agent walking but after an hour I had not come across it once. Only difference here is that I disabled the animations to reduce clutter.
At the bottom of the screen, all the agents walk to the same spot (the middel of the blue circle) first, after that the next point is set (to the right, through the maze). Some of the agents walk in a nice curve, some start their curve and then halfway through it go straight for the next target and some do a jiggle there. EDIT: I guess this can be attributed to the path not being calculated yet sometimes.
At 0:23 you can see the first jiggle just top right of the red square.
I couldn’t get a capture of it now, but they also generally mess up just in front of the red object while moving up.
Another note: if I use AIPath instead of FollowerEntity it works just fine. Exact same test case, exact same code & parameters used (where applicable).
Hmm, pretty difficult one-- I’ve been bouncing back and forth between the video and Unity. Can you disable ‘Allow Rotating On The Spot’? Not sure if that’ll give you the moment you want but I’d like to see if that stops the spinning first.
That was one of the things I tried initially and did not fix it unfortunately.
I’ve gone back to AIPath for now because we’re on a bit of a deadline this week, with the Simple Smooth & Funnel modifiers it’s somewhat close to FollowerEntity (although FollowerEntity creates nicer looking paths imo). I’m not strapped for performance (yet) so I’m content leaving it as-is for now, but I’d love to swap back to FollowerEntity to free up the performance before we ship.
Yes, it looks similar. I’ve just recorded a video where I’ve been able to show an extreme case:
After circling for 15 seconds he just continued to walk to the destination normally. In this video, Local Avoidance was disabled, so these were the settings:
In both examples I get the vibes that your agents are all trying to “circle back to a missed point”- and I would’ve thought that increasing the agent radius more would help? but @Aceria says he tried that so I’m not so certain. Can you both try a 1 meter radius if you haven’t already? And Aceria if you have already let me know?
Interesting note Yeah do what you can to try and get that over and I’ll see what I can dig up. If Aron needs to get involved on this it’ll be helpful to have all that information regardless
I’ve just send you a DM with an example project where it can clearly be replicated. The problem is really the time scale. With a time scale of 1, it works fine, but if it is increased, the problem occurs.
I hope that will help to fix it. If you need any more information, just let me know
Hey there, so I was waiting hoping OP would be able to rejoin the conversation so I hadn’t looked at it yet. But I just took a look and I did some tinkering around— I immediately noticed that the node size was rather tiny so I messed around with that with the time scale demo and… it looks better to me?
Can you try that and see if you’re seeing it the same way I am? There’s a very solid chance that I’m just looking “for the wrong things” since I’ve spent less time with it than you two, but their movements are a LOT cleaner with bigger node sizes in my testing even when I change it during runtime.