Surround task not updating agent rotation after reached destination

MarkusKer

Member
Hello, to me it looks like the surround behavior tree task stops updating the agent rotation after reaching the destination. After the destination is changed to another location the agents moves without updating the rotation according to the navmash agent's direction. I was able to trace it back to the "NavMeshAgentMovement" script.

There the "m_NavMeshAgent.updateRotation" value is false after reaching the target. I understand this must have to do with not wanting the agent to rotate at the destination. However, it seems like the "m_NavMeshAgent.updateRotation" value is not set back to "true". Following this logic, the Stop() and OnEnd() functions are responsible for setting the value to "true".

Those functions are not being called from the "surround task" as it is continuous.
I am unsure how I can fix this issue or how to reenable the value in a safe way. My attempts ended with the agent jittering.

Regards,
Markus
 
The problem exists in a clean project with updated packages as well. I can send a download link to the project. I set up a test scene where the target is animated to reproduce the issue. The target will move once the agent reaches it. At that point the rotation will be messed up, causing the control to move backward.
 
I am currently at devcom and am not able to look at this right now. I have made a note of it and will be able to take a closer look at it next week.
 
I was getting an issue where if the target moved after the agents had surrounded it their rortations wouldn't update. I resolved this by adding
Code:
"if(tacticalAgent.TargetTransform) tacticalAgent.RotateTowardsPosition(tacticalAgent.TargetTransform.position);"
To line 71 of BD Tactical Surround script.

Note, this is without UCC, I'm using BD to control RPG Builder AI
 
Top