Search Unity

Question of Mass

Discussion in 'Physics' started by thegreyman1, Feb 9, 2016.

  1. thegreyman1

    thegreyman1

    Joined:
    Jun 10, 2010
    Posts:
    164
    Quick question, when you set the mass of an object in Unity, is that number actually correlating with any realworld unit or is it just arbitrary? For instance, if I set somethings mass to 1000, does that roughly correspond to 1000kg of real world weight?
     
  2. grizzly

    grizzly

    Joined:
    Dec 5, 2012
    Posts:
    357
    Unity is officially unit-less however most people just stick to the metric system which is no surprise considering that the gravity setting for PhysX defaults to its metric value of 9.8m/s. It's all relative so you're good if you stay within the same system.
     
  3. thegreyman1

    thegreyman1

    Joined:
    Jun 10, 2010
    Posts:
    164
    So what does this mean in practical terms? Is 1000 units roughly equivolent to 1000kg or are all the mass values just relevant to one another?
     
  4. grizzly

    grizzly

    Joined:
    Dec 5, 2012
    Posts:
    357
    Relativity simply means that units for mass/distance/velocity etc must be defined within the same system (metric in your case) for realistic behavior. If an object weighs 1000 units then yes (in metric) it's exactly 1000kg (regardless of how many other objects there are). If an object is 50 units in length then (in metric) that's exactly 50 meters in length.
     
  5. alexisrabadan

    alexisrabadan

    Joined:
    Aug 26, 2014
    Posts:
    82
    Just read this http://docs.unity3d.com/ScriptReference/Rigidbody-mass.html

    It recommends that for most objects you should keep the mass between 0.1 and 10 to avoid making the physics engine unstable. Make your object masses relative to another, although you can make a car 1500 units, it might be better to make it 1.5, a person 0.1 and a truck 10. Or keep the person at 1, the car at 10, and a ball at 0.1.
     
  6. Todd-Wasson

    Todd-Wasson

    Joined:
    Aug 7, 2014
    Posts:
    1,079
    The acceleration of gravity in Unity is 9.81 units/sec^2, so mass = 1 refers to 1 kg. Force is Newtons, distance is meters. I always use real units in physics unless there's a very good reason not to.
     
  7. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    396
    Nope, it's about rigidbodies masses ratio. Car weighting 1500 is absolutely fine as long as it's not affecting more than ten times lighter rigidbodies ( lighter than 150 ). But in practice even twenty times lighter rb should be fine, as long as you're not stacking them.