Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Avoid the character jumping because of capsule collider

My unity game have a character with a capsule collider. When the character hit another collider on the spherical part of the capsule, the character is send in the air. How to avoid that?

Here is a video to explain the problem

I already have some solutions but it doesn't really work:

  • Use a cylinder collider instead of capsule, but it doesn't exist. I tried to make one with meshcollider and the result is not as good as a caspule collider since the meshcollider is not perfectly rounded. I also tried to make one with many rect collider but it produce same problems as meshcollider.

  • Set a really big gravity force when the character is on the ground, but the problem is that I have inclined planes in the game, so it doesn't work neither.

Thank you for your help

like image 754
Benjamin Lucidarme Avatar asked Apr 23 '20 11:04

Benjamin Lucidarme


1 Answers

I might not be right but I think you should delete the capsule collider and add a Mesh Collider or you could also just add colliders to each part of the player which would take longer but I think that's what you're needing. So add sphere colliders to the head, box colliders to the arms and etc.

like image 78
StrangeJmaster Avatar answered Nov 12 '22 19:11

StrangeJmaster