Search Unity

Simple (?) question: nonkinematic to kinematic collisions & physics

Discussion in 'Physics' started by Greylander, Jan 24, 2016.

  1. Greylander

    Greylander

    Joined:
    Jan 23, 2014
    Posts:
    4
    I'm just doing some experimenting trying to understand. And the docs don't seem to address this point.

    If a NON-kinematic object with collider hits a kinematic object, shouldn't this work the same way as if the NON-kinematic object hit a static collider?

    I would expect the kinematic object to not react (this happens) but I would expect the NON-kinematic object to bounce.

    In my experiment the static collider and the kinematic collider have the same properties. The NON-kinematic collider bounces off the static collider, but passes right through the kinematic collider.

    In the documentation is says "Kinematic rigidbodies should be used for colliders that can be moved or disabled/enabled occasionally but that should otherwise behave like static colliders."

    What could I be missing here? Surely I don't have to script such interactions.

    I have not tinkered with the collision matrix (terminology??) in the physics settings. Every box is checked.

    Just for completeness here are inspector images, though I don't think there is much to see here...

    NON-kinematic collider:

    upload_2016-1-24_12-11-32.png

    kinematic collider:
    upload_2016-1-24_12-12-14.png
    staic collider:
    upload_2016-1-24_12-12-46.png
     
  2. Abhinav91

    Abhinav91

    Joined:
    Oct 21, 2013
    Posts:
    67
    An observation, the first pic says "NON-kinematic collider" but Rigidbody isKinematic is checked. I assumed you might have accidentally mixed up the pics.

    As for the issue you are having, how are you moving the Non-kinematic object?
     
  3. Greylander

    Greylander

    Joined:
    Jan 23, 2014
    Posts:
    4
    The kinematic collider actually gets iskinematic set to false be script. I am quite sure this is happening. I have turned it off and even set it to false everywhere int he script.

    To provide a better picture:

    I am messing around with the MAKING AN "ANGRY BIRDS" STYLE GAME - PART 1. Tried adding a collider for the "stem" of the catapult (actually just a circle collider where the 3 branchs of the slingshot meet. Added the collider component to the "back" or "parent" component of the catapult.

    I leave the asteroid connected to the catapult by the spring joint and let it flop around. If I stretch far enough, it will hit the ground. But it won't hit the collider on the catapult.

    Hmmm... this thought just occurred to me: if two objects are connected by a spring joint, are collisions between them ignored? That would explain much.
     
  4. Greylander

    Greylander

    Joined:
    Jan 23, 2014
    Posts:
    4
    Yup, just did a test. A collider on either part of the catapult is ignored by the asteroid (so collisions with objects connected by spring joint or children thereof get ignored). I added a new object with kinematic collider, and it works as expected.