Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Really dumb question - scale of Plane compared to Cube

Discussion in 'Editor & General Support' started by LD, Nov 6, 2009.

  1. LD

    LD

    Joined:
    Nov 6, 2009
    Posts:
    40
    Hi,

    This is no doubt a really dumb question, and is exactly the kind of question you've been thinking would be posed by the army of newbies marching towards Unity. At least I haven't asked how to build WOW or Crysis in a weekend ;)


    I have created a Plane. It's scale is 1x1x1.
    I now create a cube. It's scale is 1x1x1

    Why is the Plane exactly 10x larger than the cube?

    I've searched the forums and Google, but either nobody has posed this question or my search terms aren't the right ones..

    Thanks :)
     
  2. antenna-tree

    antenna-tree

    Joined:
    Oct 30, 2005
    Posts:
    5,324
    The plane is a 10x10 unit mesh. It was pretty much just an arbitrary decision to make it that size but was also given that scale since most people will throw it in the scene to use as a quick floor or wall.
     
    DaddyCat94114, ow3n, Ishidres and 3 others like this.
  3. Troy-Dawson

    Troy-Dawson

    Joined:
    Nov 2, 2009
    Posts:
    120
    because a plane is a place to put cubes.
     
  4. LD

    LD

    Joined:
    Nov 6, 2009
    Posts:
    40
    Thanks. Is there anything in the IDE that actually shows the *size* of something in the scene?

    For my example above, I'd expect the cube to show - for instance - a length of 1, but the plane to have a length of 10.

    Is there something along those lines?
     
    Rejutka likes this.
  5. filipe.calasans

    filipe.calasans

    Joined:
    Oct 31, 2014
    Posts:
    1
    LD,

    I have the same doubt. Did you get any answare ?

    Thanks.
     
  6. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,741
    Short answer, no. The cube is still 1x1x1, the plane is still 10x10, and there's still no good explanation for this. However, a couple of versions ago, they added a "quad" primitive on that menu, which creates a 1x1 "plane".

    As for the actual size, you can, in code, get the bounding box of the renderer, which is about as close to the "real size" as you will be able to get. You could even an extension method for the Transform inspector to display this info in the IDE.

    And finally, five years and 8 days. Impressive necropost.... even more impressive that the issue is still valid!
     
  7. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    wow, you necro'd a five year old thread.

    And yes this problem has been solved. Use this free thingy from the asset store:
    https://www.assetstore.unity3d.com/en/#!/content/13534

    It lets you view and set the absolute sizes of an object by entering values in the field, and it has a button to "fix" the model by setting your inputted value as the default scale (ie, the object will be that absolute size when its scale is set at 1,1,1)

    it can't integrate fully with the transform dialog, i don;'t think that's possible with unity extensions. but you can use it to fix the default scale of objects to 1^3 units so that the "scale" field in the transform properties becomes meaningful
     
  8. YahooAnswers

    YahooAnswers

    Joined:
    Feb 9, 2016
    Posts:
    2
    Not a dumb question at all. Had me scratching my head too. This seems like a really bad decision on behalf on the developers. Units should be consistent but aren't.
     
  9. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,741
    The units are consistent, they just added in the plane as a primitive with a weirdly large mesh - the 'scale' is a multiplier for the size of the mesh, not the absolute size of the object. And we have again necroposted this, another year later, and still this stupid oversized Plane primitive exists!

    As before, though, just use the Quad primitive instead, which is 1x1 like it should be.
     
  10. Rasly233

    Rasly233

    Joined:
    Feb 19, 2015
    Posts:
    264
    Maybe it was released on 1th April, but i as well find it annoying that it dosn't show it's actuall size in inspector.
     
  11. sv54

    sv54

    Joined:
    Aug 24, 2018
    Posts:
    7
  12. eccosi

    eccosi

    Joined:
    Aug 3, 2017
    Posts:
    2
  13. zanouk

    zanouk

    Joined:
    Nov 1, 2021
    Posts:
    1
    Funny, the necro-posts on this thread!
    The most recent being just yesterday after 3 more years...

    I agree, they could mention the 10x10 default size on those pages linked above.
    Although, they do mention it on the page linked below...

    Plane: "This is a flat square with edges ten units long..."
    Quad: "The quad primitive resembles the plane but its edges are only one unit long..."

    https://docs.unity3d.com/Manual/PrimitiveObjects.html

    Good question! :)

    P.S. This is my first post, and it's on a thread that was started 12 years ago.
     
    GreenCubeGames likes this.
  14. martinbarker1

    martinbarker1

    Joined:
    Aug 26, 2021
    Posts:
    1
    For what it is worth (now 12years and 3 months from initial post) this issue has cost me about 12 hours debugging, yesterday and today. I had a plane scaled to 10,1,10 and assumed it was 10 x 10. I could not work out why my player driving to random points ranging for X and Z between +/- 10, would just stay near the center of the plane.

    NOW I know why! The plane is really 100 x 100!! This really is a trap for young 'players' and is contrary to several tutorial videos I've watched. One commentary I remember is ,"units can be whatever you want in Unity", but generally people assume 1 means 1 metre". (Except if you're a plane, then 1 means 10 meters!!!)
     
  15. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,741
    You don't quite have it. This doesn't have anything to do with whether a unit is a meter or an inch. The "Plane" object's mesh data is 10 units wide, regardless of what those units mean. The object's scale is a multiplier for the size of the mesh data.

    It is true that the Plane object being so out of sync with the other primitives is silly, and there's no reason for the Plane primitive to still exist, and confuse rookies with its oddball scale - particularly since the Quad primitive exists and does exactly the thing that people tend to assume that the Plane primitive does.
     
  16. robpen

    robpen

    Joined:
    Aug 19, 2012
    Posts:
    16
    thanks - just ran into this issue and glad this thread was here to provide a quick answer
     
  17. Rejutka

    Rejutka

    Joined:
    Feb 19, 2017
    Posts:
    15
    Does anyone know what this asset was and if there is still something like it available? Apparently the UI still doesn't show the unit size of objects.

    Or does the link work and I'm merely blind?
     
  18. tecbrat

    tecbrat

    Joined:
    Nov 24, 2019
    Posts:
    5
    The necro thread that just won't die.
    There is an issue with using the quad as a plane replacement: It's modeled on XY and not XZ. That is, it appears in the scene as a wall and not a floor. Sure, you can rotate it, but you have to remember that when working with it, or drop it into an empty object and deal with the container.
     
    GreenCubeGames likes this.
  19. SalehShaghalah

    SalehShaghalah

    Joined:
    Aug 3, 2023
    Posts:
    1
    its 2023 folks, this thread must live on as long as the issue still resides in Unity. I found this in the asset store that could help for any folks out there who wanna make something realistic per say but it costs 10€.....
     
  20. CRMWilson

    CRMWilson

    Joined:
    Sep 1, 2023
    Posts:
    1
    Ok, in an effort to finally put this thread down for good, I made a little Editor extension to show me the actual size of objects in unity, based off the renderer.

    Based off the code I found in this thread on extending the inspector to show the world space of an object alongside the local space: https://forum.unity.com/threads/extending-instead-of-replacing-built-in-inspectors.407612/

    Using that I then tweaked it slightly and then added an extra field for the total size of the object:
    upload_2023-9-1_15-27-15.png upload_2023-9-1_15-27-34.png

    This method probably isn't perfect, but it seems to work well enough for me, and at the very least allows me to see when the scale is not what it appears to be. The code for this, (again, based off the code in the linked post):


    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEditor;
    3. using System.Reflection;
    4. using System;
    5.  
    6. [CustomEditor(typeof(Transform), true)]
    7. [CanEditMultipleObjects]
    8. public class CustomTransformInspector : Editor
    9. {
    10.     //Unity's built-in editor
    11.     Editor defaultEditor;
    12.     Transform transform;
    13.  
    14.     void OnEnable()
    15.     {
    16.         //When this inspector is created, also create the built-in inspector
    17.         defaultEditor = Editor.CreateEditor(targets, Type.GetType("UnityEditor.TransformInspector, UnityEditor"));
    18.         transform = target as Transform;
    19.     }
    20.  
    21.     void OnDisable()
    22.     {
    23.         //When OnDisable is called, the default editor we created should be destroyed to avoid memory leakage.
    24.         //Also, make sure to call any required methods like OnDisable
    25.         MethodInfo disableMethod = defaultEditor.GetType().GetMethod("OnDisable", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
    26.         if (disableMethod != null)
    27.             disableMethod.Invoke(defaultEditor, null);
    28.         DestroyImmediate(defaultEditor);
    29.     }
    30.  
    31.     public override void OnInspectorGUI()
    32.     {
    33.         EditorGUILayout.LabelField("Local Space", EditorStyles.boldLabel);
    34.         defaultEditor.OnInspectorGUI();
    35.  
    36.         //Show World Space Transform
    37.         EditorGUILayout.Space();
    38.         GUI.enabled = false;
    39.         EditorGUILayout.LabelField("World Space", EditorStyles.boldLabel);
    40.         EditorGUILayout.Vector3Field("Position", transform.position);
    41.         EditorGUILayout.Vector3Field("Rotation", transform.rotation.eulerAngles);
    42.         EditorGUILayout.Vector3Field("Scale", transform.lossyScale);
    43.  
    44.         Renderer[] renderers = transform.GetComponents<Renderer>();
    45.         Vector3 size = Vector3.zero;
    46.         foreach (Renderer r in renderers)
    47.         {
    48.             size += r.bounds.size;
    49.         }
    50.         if (renderers.Length > 0)
    51.         {
    52.             EditorGUILayout.Vector3Field("Actual Total Size", size);
    53.         }
    54.  
    55.         GUI.enabled = true;
    56.     }
    57. }
    (to get it to work, make sure to put this script in a folder called "Editor" in your assets folder)
     
    Last edited: Sep 5, 2023