Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. We're looking for your feedback on the platforms you use and how you use them. Let us know!
    Dismiss Notice
  4. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  6. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  7. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  8. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Turn off collider 'weights' in physics

Discussion in 'Physics' started by PelvisParsley, Aug 7, 2018.

  1. PelvisParsley

    PelvisParsley

    Joined:
    Aug 9, 2016
    Posts:
    54
    I want to imitate a half filled bottle using physics, its working great and looks something like this:
    Capture.PNG

    The box collider acting as a weight. The thing is, I want the rest of the body to collide as well. I tried Rigidbody.CenterOfMass but it doesnt do anything. Is there any way to get this functionality with a full collider, or add another collider that doesnt contribute to the center of mass
     
  2. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    1,144
    Keep the collider for the entire bottle, then configure the mass and the center of mass. That's the way to do it. Most likely you're not configuring the center of mass properly.
     
  3. PelvisParsley

    PelvisParsley

    Joined:
    Aug 9, 2016
    Posts:
    54
    What do you mean not configuring it properly? Could you elaborate please. I have created an empty GameObject, and assign its position as the COM at runtime. Tried using both Local and World space. But the bottle still rotates at the center of all colliders
     
  4. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    1,144
    First, I'd use the bottle mesh itself as collider (add a mesh collider, then mark it as convex). Then, configure the center of mass to be at the bottom of the bottle. That's the way it works, I don't know how could I elaborate further. The documentation explains how to use the center of mass property.