- Home /
NavMeshAgent hindered by rigidbody
I have enemies with NavMeshAgents attached.
I want the enemies to collide with one another, and so I have rigidbodies attached. This works. However, they will not go over slopes with rigidbodies attached, but will if I make them kinematic or disable the rigidbodies altogether, but this causes them to intersect each other. Any ideas?
Hum... have you made sure that the baked area of the map goes on the slope? Have you checked to make sure the slope isn't stepper then the allowed amount?
Yes. I actually solved the issue. The box collider on my enemies was not behaving itself. It was almost like the corner of the box was 'digging into' the ramp, preventing the enemy from moving up. Switching to a capsule collider and fiddling with the Nav$$anonymous$$eshAgent's base offset solved the problem.
Answer by jakejolli · Feb 21, 2015 at 05:48 AM
I solved the issue.
The box collider on my enemies was not behaving itself. It was almost like the corner of the box was 'digging into' the ramp, preventing the enemy from moving up. Switching to a capsule collider and fiddling with the NavMeshAgent's base offset solved the problem.
Answer by lattman · May 19, 2015 at 06:25 AM
If you are using Unity 5 you may want to read this section in the docs:
"Using NavMesh Agent with Other Components"
If both NavMesh Agent and Rigidbody (non-kinematic) are active at the same time, you have race condition
Both components may try to move the agent at the same which leads to
undefined behavior
It could be related to the problem you were seeing.