- Home /
The question is answered, right answer was accepted
Nav mesh agents forcing player upwards
So I've been working on a 3D game for a while now, and have some basic enemies that chase the player. Everything works fine until they get exceedingly close to the player, where they will then force themselves underneath the player, forcing the player above them, and making a totem pole like structure. It is quite comical but really not what I want to happen.
It seems to only happen when the navmesh agent is moving, otherwise collisions happen as normal. I did try getting around it using stopping distance, but the problem still arises when the player moves into the enemy while it is moving.
What is the collider setup of your player and your enemies? Normally ai with just the navmeshagent attached won't push anything up, only away. Sounds to me like an unusual collider setup on both sides.
Besides the collider and rigidbody set-ups as betaFlux mentioned, check and make sure the step height of the Nav$$anonymous$$esh agents as well as the max slope it can traverse isn't unnaturally high...
https://docs.unity3d.com/$$anonymous$$anual/nav-Height$$anonymous$$esh.html
Though I'm unsure if Nav$$anonymous$$esh agents stepping over each other is an intended system behaviour.
Thanks guys, turns out I needed to add a collider to my player. Spent too much time focusing on the enemies.
Follow this Question
Related Questions
Disabling collisions between Nav Mesh Agents? 2 Answers
Can't use Navmesh Obstacle on AI? 0 Answers
NavMesh on collision dectection activate,On collision activate navMesh 0 Answers
Filtering NavMesh Agent Forces 0 Answers
How to make whole navmesh agent avoid carves rather then center of it? 0 Answers