Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Let us know a bit about your interests, and if you'd like to become more directly involved. Take our survey!
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. 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,212
    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,212
    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.