Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

2D Kinematic Rigidbody and Edge Collider

Discussion in 'Physics' started by Kidara, May 10, 2020.

  1. Kidara

    Kidara

    Joined:
    Jul 6, 2017
    Posts:
    16
    Hello there,

    I have an object A with a polygon collider and 2D Kinematic Rigidbody and Full Kinematic Contacts active.
    Then I have an object B with edge colliders. I tried to put on object B also a rigidbody 2d Kinematic or static with Full Kinematic Contacts active.
    I want object A to collide with object B. If object A has rigidbody set to Dynamic, all works, if I switch to Kinematic, no matter which combinations I try, collisions don't happen. Any suggestion?

    PS: I move object A with user input, so I want it to be Kinematic.

    Ty in advance
     
  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,326
    What do you mean by collisions? Do you mean collision response? Kinematics don't have a collision response because that's how they work i.e. they are not affected by external forces from collisions, gravity etc.

    Maybe you're confused over what Physics2D.useFullKinematicContacts does? Assuming that, if you read the docs page I just linked which explains that it isn't turning a Kinematic body into a Dynamic body by producing a collision response because that would just be a Dynamic body! It tells the physics system to produce contacts between Kinematic/Kinematic and Kinematic/Static. This means you can retrieve the contacts and you'll colision callbacks too.
     
    Kidara likes this.
  3. Kidara

    Kidara

    Joined:
    Jul 6, 2017
    Posts:
    16
    Yeah, sorry for misunderstanding. I thought that with "useFullKinematicContacts" enabled I would get collision response. Solved applying manual calculations on collision hits detected.