Custom NavLinks with Detour Crowd Manager

Hey All,

So I noticed this odd behavior and pinned it down within code.

So using a custom nav link my AI does the custom logic on my SetMoveReachedLink delegate but it won’t move. If I remove the UCrowdFollowingComponent for a simple UPathFollowingComponent it will move through the linked area. (In this case a door way.) I’ve pinned this down to UCrowdManager::UpdateAgentPaths on line 842 (in 4.22, code lines move):

					// switch to waiting state
					DetourCrowd->setAgentWaiting(AgentData.AgentIndex);
					DetourCrowd->resetAgentVelocity(AgentData.AgentIndex);

Which as commented, sets the Detour Crowd to a waiting state. I assume it’s waiting for the custom link itself to tell it to start again? Which if that’s the case it should be as easy as calling ResumeAgent with the CrowdFollowingComponent but I pose that the whole wait should be an option within the custom link. Simply because you may not desire any pause when the agent reaches the custom link.

Thoughts?

Additionally, this is also to help anyone else who goes to enable detour crowds but finds all their custom nav links oddly busted.

Thanks,
Michael Brune

1 Like

Actually simply resuming the move causes the agent to run through the same logic. Thus causing the agent to wait again and run through the same custom link logic yet again. This forces me to write my own movement in my custom link which isn’t preferred. This really needs to be optional per custom link.