- Home /
Collider problems
I'm having a couple collision issues in my game, that hopefully can be solved.
In my game, the player is cube, being moved via a character controller. I have also tried adding colliders to my player, and increasing the radius of both the collider and the character controller, but neither has helped.
The problem is that if an ai (which is a capsule containing a capsule collider, moved as a navmesh agent), tried to move onto my player, it is possible for it to shove the player through a wall (which contains a cube collider). If I make the wall's cube collider thicker, it takes more time, but the player still goes through. It seems like whatever force the navmeshagent is applying to my player's collider is greater than whatever counter-force the wall's cube collider is applying.
Now, I could solve this pretty easily by stopping my navmesh agent once it gets close to the player, but I wonder if there is a way to guarantee the player can't be shoved through (maybe by increasing the counter-force provided by the wall's collider, if that is indeed what it is?).
The second problem, which might be related I guess, is that my player has a gun, which itself has a capulse collider around it. Yet, my player can easily push the gun through walls.
Any insight into these problems would be greatly appreciated!
Your answer