- Home /
NavMeshAgent Not Registering Correct Collision with Static Objects
My scenario: The nav agent follows the player and if it collides with certain tagged objects, it changes behavior.
The core behavior of the nav agent works using the basic: agent.destination = player.transform.position.
But here's the issue - the agent's collision behavior is offset from where the actual collision should occur by 2-3 meters - if it collides with the test box collider I have set up, nothing happens. But if I lead the agent to a spot away from the collider, the collision behavior registers.
Basically, the nav agent is hitting something invisible to trigger the behavior and I cannot figure out what it is hitting or why.
What else to note: 1) Everything works a-ok when I set the agent to collide with my moving player object. 2) I have rebaked the NavMesh. 3) I have tried to drag and select objects where the invisible collision occurs, but nothing gets selected. 4) The collision behavior is contained in OnTriggerEnter. 5) I have duplicated colliders, made new ones, changed tags, etc. still the same problem occurs.
Any insight is much appreciated!