Search Unity

Unity Use meter or centimeters as its default unit

Discussion in 'Editor & General Support' started by Mackey@ehsiplus.com, Jul 13, 2009.

  1. Mackey@ehsiplus.com

    Mackey@ehsiplus.com

    Joined:
    Jun 27, 2009
    Posts:
    45
    I asked before if What is the Default unit in unity. Someone said
    1 meter = 1 unit in unity but i ran across this in the wiki:

    Setting Unit in Maya
    In Maya, you can set your unit size to the same as Unity units by clicking on on Window => Settings/Preferences => Preferences then clicking on Settings => Working Units => Linear and changing it to "centimeter". From now, centimeter is the unit we work on in Maya.

    That says to me the 1 centimeter = 1 unit in unity.

    What is the default unit in unity?

    Meters or Centimeters?
     
  2. jcarpay

    jcarpay

    Joined:
    Aug 15, 2008
    Posts:
    520
    meters
     
  3. jbuck

    jbuck

    Joined:
    Jun 9, 2009
    Posts:
    169
  4. runevision

    runevision

    Unity Technologies

    Joined:
    Nov 28, 2007
    Posts:
    1,686
    There is no "default unit" in Unity. Just choose what you want units to represent and stick to that. If you have gravity in your game, you need to set it up to match the unit representation you have decided on (if you want it to be realistic). The gravity per default is set to be like earth gravity as measured in meters per second, but if you use centimeters for your units, you can just multiply the gravity by 100.

    Rune
     
    othysotto likes this.
  5. Wadoman

    Wadoman

    Joined:
    Dec 8, 2007
    Posts:
    336
    I'm not so sure, but correct me if i'm wrong.

    I just did a test. I have been using meters with unity iPhone so far and so far when I import my character if I set the scale factor to 1 the character is 100 times larger than the unity cube with scale 1,1,1. I have to set either the characters scale factor to .01 or set the xyz scale to .01 to get it to be relative with the unity cube.

    Now I just set maya to centimeters scaled my character down froze transforms and exported with centimeters and now on import both scale factor and xyz scales are at 1 and everything is the same in relative size. So it seems to me centimeters is unities units.

    Now I know you can use whatever units you want in unity, but my question I have posed before is given this scaling in the engine when dealing with meters is there any kind of performance hit because the engine has to maintain geometry scale other than 1?
     
  6. runevision

    runevision

    Unity Technologies

    Joined:
    Nov 28, 2007
    Posts:
    1,686
    No, whatever scaling issues happen when you import things into Unity is a by-product of the import process only. It does not mean that Unity itself has a specific default unit.

    No. The performance is the same.

    Rune
     
  7. Wadoman

    Wadoman

    Joined:
    Dec 8, 2007
    Posts:
    336
    great thanks for the reply.
     
  8. Deleted User

    Deleted User

    Guest

    If you don't treat Unity units as meters, then there are many settings and defaults besides gravity you may need to change - anything involving distance or speed, e.g. the Physics Manager has sleep velocity, min penetration, Quality Settings has shadow distance, cameras have near and far planes, lights have ranges...

    In that sense, I consider meters as the "default" unit in Unity.
     
  9. runevision

    runevision

    Unity Technologies

    Joined:
    Nov 28, 2007
    Posts:
    1,686
    Those settings you mention are not only dependent on whether you use meters or something else, but also on the scale of your subject matter in the first place. For example, you probably want to adjust those settings differently depending on whether you are creating a game about ants or about huge space ships, even though you might use meters as units in both cases.

    Rune
     
  10. jbuck

    jbuck

    Joined:
    Jun 9, 2009
    Posts:
    169
    I'll add that I've experienced physics performance issues and skeletal animation problems if the object's scale transform is not 1,1,1.

    You can use the FBX Import settings to scale objects on import (keeping your transform at 1,1,1) but that can affect skeletal animation as well. I'm not surprised as it's often not good to scale bones except for length.
     
  11. kemch

    kemch

    Joined:
    Jan 14, 2010
    Posts:
    3
    I did some tests because I wanted to know how big, and what direction to model characters in before I started rigging them.

    I got the best results by setting my Maya working units to centimeters, Y-up, and having characters face the +Z direction. With these settings, characters are about 3 or 4 cm high in Maya.

    Setting Maya working units to Meters brought in the character to almost the size of the whole level.

    I tested this next to Lerpz and the platformer tutorial. I did not convert to FBX first, or adjust any values in Unity's FBX conversion settings.
     
  12. Wadoman

    Wadoman

    Joined:
    Dec 8, 2007
    Posts:
    336
    Yeah That is the same method I use. Assuming they used Maya to create Lerpz. If you create a box 2 units high in Maya while set to centimeters export it to unity. Import settings scale factor to 1 and the objects XYZ scales are also 1 then place it next to Lerpz it will be the same size, you'll also notice that Lerpz's scale factor and XYZ scale is also 1to1. IF you do this with meters your scale factor will need to be .01, which is fine, but I like everything to 1 to 1. In the big picture it doesn't matter what scale you use as long as you stay consistent with it. I also use the Yup and forward +Z.
     
  13. llde_chris

    llde_chris

    Joined:
    Aug 13, 2009
    Posts:
    205
    Aren't there other settings aside from gravity in the Physics manager that also have defaults that assume meters?

    E.g. Sleep Velocity, Min Penetration for Penalty
     
  14. ristophonics

    ristophonics

    Joined:
    May 23, 2014
    Posts:
    25
    I think the default is meters but check the Inspector on your 'asset' and make SURE the Scale Factor is 1. ( NOT '0.01' )
    By increasing the scale factor from its default .01 setting to 1.0 you are getting a Meter import instead of the Centimeter. DO THIS BEFORE you drag the Asset into your Hierarchy and you should get what you are looking for.
     
  15. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    12,322
    What's actually going on is that the default import settings scale models by 0.01. You can change this to whatever you want. The instructions are incorrect insofar as they aren't chaining anything to "Unity units", it's just matching up the output scale to be as the Unity importer expects it to be... which is subtly but importantly different.

    Aside from that, as others have said, there's no real "default unit". However, the physics system's default settings assume that 1 unit = 1 meter. It can of course be tweaked if you so desire, though.
     
  16. martibergoglio

    martibergoglio

    Joined:
    May 28, 2015
    Posts:
    14
    Hi, me and my friends are making a game in Unity but we are noobs in some features, we are working in a platformer game with logic puzzles in that the character live in an ethereal world like a fantastic world, every size of every plants or enemies are realistic, i mean they sizes are like a human. What "Pixel per Unit" did you recomend me? We are using puppet2d so i want to know if having 100 pixels per unit affect in some way the rigging or bones or skinning or something important in the animation or the process of making it
     
    Last edited: Jul 6, 2015
  17. Deleted User

    Deleted User

    Guest

    SORRY...

    I'm still little lost (noob to Unity 5) you said 1 unit = 1 meter, right, but if you want you can change it. I've been all over Unity, well almost, and I can't find where to change it at.
     
  18. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    12,322
    You don't "change" it. A unit is a meter if you treat it like a meter. It's a centimeter or an inch or a solar unit if you treat it like one of those instead.

    By default gravity is set up to be (0, -9.8, 0), which you may recognise as approximate real-world gravity in meters per second squared. So if you're not treating a unit as if it's a meter and you're using gravity then you'll probably want to update that accordingly.
     
  19. Deleted User

    Deleted User

    Guest

    hate to say it, lol
    I get it, it makes scene to me now, never thought of it that way. thank you angrypenguin
     
    angrypenguin likes this.
  20. JeremiahJ

    JeremiahJ

    Joined:
    Nov 1, 2016
    Posts:
    28
    Not quite. What units are the camera clipping planes measured in? It can't read your mind and adopt whatever scale you are using - there's a unit for that measurement. What is it?

    Sorry for resurrecting an ancient topic; it seemed better than starting a new post.
     
    othysotto likes this.
  21. eskivor

    eskivor

    Joined:
    Aug 5, 2015
    Posts:
    6
    Haapavuo likes this.
  22. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    7,253
    What did you expect from a decade old necro thread?
     
    Haapavuo likes this.
unityunity