Search Unity

Make object able to collide with others, but not affect them?

Discussion in 'Physics' started by ethanicus, Dec 5, 2019.

  1. ethanicus

    ethanicus

    Joined:
    Aug 24, 2015
    Posts:
    40
    I'm working on a VR space ship game that's coming along pretty well, but I've got a major issue: small props like guns and blocks are actually moving the ship around from the inside. If I throw a prop at the wall of my ship, it'll send the whole thing sliding to the side with it.

    The ship is set to 1500 Mass and the props are all 1 Mass, so I don't understand how something so small is causing such massive force on something so much larger than itself. Everything is set to zero gravity as well, because if the props are using gravity, they weigh the ship down pretty quickly (the ship has no gravity).

    I guess what I'm asking is for some way to make this behavior stop. The best outcome would be that I can set props to not be able to move the ship at all, but still be able to touch the ship and be moved by it. I can't set the ship to kinematic (as far as I know) because then it can't move properly.

    Any insight would be amazing. I really don't know how to fix this.
     
  2. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    That problem might be related with colliders. When two colliders belonging to different bodies inter-penetrate, then the physics may apply velocities to the colliding bodies in order to separate them. These de-penetration velocities are applied independently of the mass.

    Also, the mass difference (1500 kg vs. 1 kg) is not so huge. 1500 kg is the mass of a standard car. If you have, lets say, 20 props it means 20 kg, which is the mass of a large suitcase. That mass surely has some influence in a standard car.

    The "extra mile" would be implementing some kind of stabilization in the space ship that monitors the velocities and applies proportional counter-forces to compensate any external interactions.
     
  3. ethanicus

    ethanicus

    Joined:
    Aug 24, 2015
    Posts:
    40
    Thanks for the info. I posted this on Reddit but forgot to update over here.

    I had the props parented to the ship, and when I unparented them it seemed to fix the issue (mostly). Someone also said that multiple colliders under a single Rigidbody makes a compound collider.