Benjamin Lucidarme
Benjamin Lucidarme

Reputation: 1752

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:

Thank you for your help

Upvotes: 6

Views: 3301

Answers (2)

Dave
Dave

Reputation: 2842

You can propably fix the unwanted behavior:

  • with a different physics material for your colliders. Removing bounciness may help.
  • by adjusting scales of your objects.
  • by changing the collider of the ground from a box collider with sharp edges to a mesh collider with slopes on the edges.
  • by adding a code that will snap your character to the ground.

There is a great tutorial on character movement from Catlike Coding I can recommend: A series about controlling the movement of a character.

Upvotes: 0

StrangeJmaster
StrangeJmaster

Reputation: 61

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.

Upvotes: 2

Related Questions