- Home /
Navmesh agents pushing character controller, how to stop this?
I'm using a modified version of the unity standard assets character controller alongside a basic enemy ai script using unity's default navmesh system but for some reason when the enemy collides with the player/character controller. The player is pushed back instead of simply not moving, is there any way to fix this? So that the player/character controller either pushes the enemy navmesh agents back or so that the character controller doesn't move when an enemy navmesh runs into them? Any help would be massively appreciated this problem has halted my progress for weeks
Answer by gigos22 · May 02, 2021 at 05:09 AM
It pushes it because it is trying to reach a point where it cannot reach, because your player is there.
Here are a few options for you:
Put a rigidbody with different masses (and no gravity) on both the enemy and player, where the player has a bigger mass.
Make the enemy going towards an offset point and not directly to the player.transform.position.
Well it came out as only two options rather then a few but this is what I could come up with on the spot..
Keep me updated :)
Your answer
Follow this Question
Related Questions
Navmesh Agent moves odd when bumped 1 Answer
how to get AI to move to the closest of the same object? 0 Answers
How to make AICharacterController able to walk on walls and ceilings? 0 Answers
I want to use NavMesh AI AND I want to place and destroy blocks. 2 Answers
I want to use NavMesh AI AND I want to place and destroy blocks. 0 Answers