Search Unity

Give both object and child colliders + rigidbody.

Discussion in 'Editor & General Support' started by GeneralGrant, Nov 28, 2012.

  1. GeneralGrant

    GeneralGrant

    Joined:
    Jun 10, 2010
    Posts:
    977
    I have a gun model that comes with a magazine clip. I want to have the ability for when the user reloads for the clip to drop and fall to the ground. I would also like the ability for the gun to be able to be shot at any part. Now to do this I added a box collider and a rigidbody component to the two objects. They don't really work well and they don't want to stay in the same space (of course).

    I notice that I can set constraints for both rotation and position in the rigidbody component. Would setting all of those to two be the best way to solve this problem while retaining functionality? Or is there a better way?
     
  2. GeneralGrant

    GeneralGrant

    Joined:
    Jun 10, 2010
    Posts:
    977
    Any ideas?
     
  3. Joseph-Ferano

    Joseph-Ferano

    Joined:
    Jul 18, 2008
    Posts:
    165
    Make sure that the rigidbodies are set to isKinematic being true since you wont be controlling the for the most part with physics. You can then only turn on physics when you need it, ex; when you want to drop the magazine.