Agent stuck to edge of graph

  • A* version: 5.2.3
  • Unity version: 6000.0.23f1

Hi there again,

I have an issue where an agents keep getting stuck to the edge (or close to) of a grid graph for no apparent reason.

I have been doing a lot of experimenting why this might be the case but I’m stuck, hence I’m here again :wink:
So far I’ve tried or confirmed:

  • hasPath=true, canmove=true and isstopped=false for every frame
  • node when stuck is always connected to walkable destination node
  • most of the times the agent slightly rotates back and forth, like jittering
  • sometimes it also super slowly moves (like 0.000001 in some direction) and after quite a while it manages to move on
  • I fiddled with desired wall distance, with agent radius, with grid graph diameter, node size and erosion in every direction to no avail
  • agent collider is turned off (and had no collision with any object before whatsoever)
  • sometimes when i disable the obstacle alltogether it moves on
  • the destination of the followerEntity is only set sparcely, so this jittering does not come from that

Thankful for every help

Best regards,
Daniel

Are you using local avoidance? Also that video isn’t playing nor downloading on my end. May want to try reencoding/reuploading it?

Oh you’re right, damn.

Maybe this works for a while longer…

I am not using local avoidance

Hi

Would you mind setting A* Inspector → Settings → Graph Coloring = Hierarchical Node Obstacles, and see if you see an unexpected obstacle in front of the agent?

I am not quite sure what I am seeing here.

In “GraphColoring = hierarchical node” there are some white boxes


in “GraphColoring = NavMesh Border Obstacles” too.


Not sure what’s going on… Would it be possible for you to share a stripped down example project with us, so that we can debug it further?

Oh, and also. Would you mind updating to 5.2.4 to see if that changes anything?

The new version lead to the same result, sadly.

Thanks for the offer but producing a stripped down version would take an ungodly amount of time I assume.

Meanwhile, I found a momentarily sufficient solution, but the interpretation for it, I’d leave to you because I do not understand what’s going on behind the scenes:

I fiddled with position and rotation smoothing and it seems that beginning from a position smoothing of 0.3 the agent is able to move on the path’s through the walls without a problem.
My first thought here was that, since the agent’s model is now lagging behind, the model itself is somehow blocked but since the collision matrix is turned off for its layer and the problem even persists without a collider, I’m not sure what to make of this information. (It also did not work for a simple stripped capsule agent, the funnel modifier seems also innocent)

Anyhow ¯_(ツ)_/¯ with position smoothing the “ghost agent” moves forward and drags the model with it which works fine for now.

Thanks for the support though, still very much appreciated!

Strange. I wouldn’t expect that to have any effect at all…

Well, guess I’ve been too early too green light it…sigh.

Now, when single agents make it through the wall, it’s working fine but when two agents make it through the wall with different paths, then the agent who is still hitting the wall will notice there is a way through, correctly calculate the path and then just …jitter again. See below video

Anyway, I might try with a stripped down demo for you some time since I’m just drawing straws here :confused:

After sheer endless testing, I found out that the AIPath component seems to accomplish what I want, which is a bit sad since I did not want to give up on ECS performance. Code and agent are both the same for FollowerEntity and AIPath

Well if you ever want us to take a look at figuring this out with FollowerEntity, you can send over that project and we’ll take a look. Could be very helpful to other users as well.