Kinematic Rigidbody2D objects do not detect collisions with Static objects

Hello everyone,

I’m experiencing an issue with my Unity 2D project where Kinematic Rigidbody2D objects do not detect collisions with Static Rigidbody2D objects, despite my setup seeming correct. Here’s a summary of the setup and the problem:

  1. Object Setup:
  • Dynamic Objects: I have objects named Shape that are draggable by the user. Each has:

    • A Rigidbody2D set to Kinematic.
    • A BoxCollider2D (IsTrigger is unchecked).
    • Collision Detection is set to Continuous.
  • Static Objects: I also have static boundary objects (fSquare_Up, fSquare_Right, etc.) with:

    • A Rigidbody2D set to Static.
    • A BoxCollider2D with a Bouncy Material.
    • No SpriteRenderer (just colliders for interaction).

2 .Collision Matrix:

  • Both the Shape objects and the static boundaries are on the Default layer.
  • The Collision Matrix has all Default x Default interactions enabled.
  1. Problem:
  • The Shape objects successfully detect collisions with other objects, such as a bouncing ball, but do
    not detect collisions with the static boundary objects (fSquare_#).
  • I’ve confirmed that the OnCollisionEnter2D method in the Shape script is being called for other
    collisions (e.g., with the ball) but not for the static objects.
  1. Debugging Steps Taken:
  • Verified that the BoxCollider2D sizes are appropriate and overlap in the scene view (Gizmos
    enabled).
  • Ensured that all scales are (1, 1, 1) and Z positions are 0.
  • Recreated the boundary objects and adjusted the BoxCollider2D size directly (without altering
    Transform scale).
  • Tested with both static boundaries as individual objects and as children of a parent object
    (Square_Perimetral).
  1. Error Log:
  • No runtime errors occur related to physics or colliders.

Question:
What could be preventing the Shape objects from detecting collisions with the static boundaries (fSquare_#)? Are there any additional settings or debugging techniques I might have missed?

Any guidance would be greatly appreciated. Thank you in advance for your help!

Only Dynamic colliders contact any body type (Static, Kinematic or Dynamic).

By default, Kinematic don’t interact with Kinematic or Static. Static don’t ever interact, they’re static.

You can set the body-type to Kinematic and turn on Rigidbody2D.useFullKinematicContacts in the inspector. You’ll then get contacts reported when a Kinematic contacts a Kinematic/Static.

Obviously you don’t get a collision response because it’s Kinematic (and that’d make it Dynamic) which is the whole point of it. You typically use queries to detect the environment and react accordingly when using Kinematic body type though i.e. don’t expect a Kinematic body to stop when it hits something, it’s Kinematic and has no collision response. You’d use a Dynamic body for that.

1 Like

Hola, MelvMay:

Muchas gracias por tu respuesta y por tu tiempo. Su explicación sobre los tipos de cuerpo y el rol de Rigidbody2D.useFullKinematicContacts fue muy útil y habilitar useFullKinematicContacts en mi Rigidbody2D cinemático resolvió el problema.

¡Gracias nuevamente!