Default off mesh link traversal of FollwerEntity stopping at start of link

I am in the process of updating to 5.0.3 and after updating my agents stop for a short time at the start of the off mesh link. I reverted back to the default off mesh link traversal and i get the same behavior.
I’m using the FollowerEntity but i create the entity via baking without using a game object.

This gif shows the issue: Imgur: The magic of the Internet

Is there a new option that can be changed to fix this? they don’t seem to traverse the same link node so i don’t see why they would prevent each other from traversing the link.

Hi

Would you mind posting the settings that you use?

of course. Sorry I wasn’t sure how much info you need (and which settings).
Pathfinder:


rvo:
Screenshot 2024-03-13 154532
FollowerEntity:

If needed i can add the code i use for setting up the managed component at runtime. I do not use the GravityState component.

Let me know if anything is missing.

Hmm. I can’t see anything strange here. Everything looks reasonable.

I guess you can’t use the FollowerEntity’s own inspector, since you don’t use that component (it has a useful debug view).
But maybe you could check the entity’s state when it stops before the link.
In particular, check what the status booleans in the movement state is (MovementState.reachedEndOfPart is the most important one).
And check when it gets its AgentOffMeshLinkTraversal component added.

while being stuck the boolean MovementState.reachedEndOfPart is set to true and the AgentOffMeshLinkTraversal component is added to the entity.

Hmm. Is it possible that you are ignoring the rotation of the agent?
The only thing that should happen before it continues moving is that it will try to rotate itself towards the other end of the link.

before my agents traverse the off mesh link they run around a corner. Rotation looks correct there. I did some frame by frame debugging and it seems like the agent is rotating but very slowly. Another observation i made is that the agent isn’t always getting stuck (but very often).

Just noticed during debugging that this never happens if i just have a single agent, which would be an indicator that they somehow influence each others rotation speed. The exact same setup worked with multiple agents before updating tough.

Hmm.

Just to test, could you add custom off-mesh traversal logic that does this:

IEnumerable IOffMeshLinkStateMachine.OnTraverseOffMeshLink (AgentOffMeshLinkTraversalContext ctx) {
    var linkInfo = ctx.linkInfo;
    var up = ctx.movementPlane.ToWorld(float2.zero, 1);
    var dirInPlane = ctx.movementPlane.ToWorld(ctx.movementPlane.ToPlane(linkInfo.relativeEnd - linkInfo.relativeStart), 0);
    var rot = quaternion.LookRotationSafe(dirInPlane, up);

    ctx.DisableLocalAvoidance();
    while (!ctx.MoveTowards(linkInfo.relativeStart, rot, true, false).reached) yield return null;

    while (!ctx.MoveTowards(linkInfo.relativeEnd, rot, true, false).reached) yield return null;
}

Or alternatively, you could try disabling local avoidance and see if that changes anything.

i tested both. The problem persists when using the given custom off-mesh traversal logic.

If i set RvoAgent.collidesWith to Nothing the agents no longer get stuck. Weird that globally disabling rvo helped but disabling it while traversing the link doesn’t affect it.

That’s very strange. You say that the agent has the AgentOffMeshLinkTraversal component, so the traversal logic should have started. And then if it immediately disables local avoidance, I don’t see how that could continue to affect it…
Are you sure the code runs?

If it is possible for you to share a small example scene showing the issue, that would help immensely in tracking this down? :slight_smile:

sure. I’ll extract the relevant logic into a separate project and send it to you. What’s your preferred way of getting the project? Via PM that contains a link to google drive?

Thanks!

That will work just fine.

Thanks!
I’ve managed to replicate this issue, and implemented a fix.
The agent’s rotation was converging very slowly to the desired rotation.

The fix will be included in the next update.

Looking forward to it. Thank you for the great support and hard work!