Collisions when two different colliders interact

I have a capsule collider on my player and a box collider on an obstacle. When my capsule is colliding with the obstacle, the capsule is getting launched into the air. Please help me figure this out!!

bandicam2024-04-1722-06-40-303-ezgif.com-video-to-gif-converter

(I never seem to understand UNITY Collisions. They always seem to be VERY Buggy even in 2 Dimensions. Am i the only one feeling this way? Please help me understand the collisions in UNITY. They always frustrate me :slight_smile: )

Hi,

Without knowing much about your game, it is difficult to interpret what I see in the video. If two game colliders collide with each other, the ones which come with a Rigidbody might bounce off. This is the expected behaviour, and also the correct behaviour in the real world.

  1. Make sure that the colliders are not overlapping.
  2. Make sure the player’s does not get moved into another collider. (Zoom in in the scene window.)
  3. Try to increase the mass of the player.

This is all what comes into my mind right now. I hope it helps anyway. :slight_smile:

Should I add a rigidbody to every object in the scene?

Would that work?

No, please don’t do that. Add a Rigidbody only to moving objects that have got a collider attached. The other game objects are supposed to be static (= unmoveable).

It looks like you have a player movement script. Are you using that to move the player? Do you use gravity or the physics engine in the movement script? If not, turn off gravity and turn on use kinematics. That may help?

Privacy & Terms