Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

New GameObject not positioned at zero (bug?)

Discussion in '2020.1 Beta' started by liortal, May 3, 2020.

  1. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    In 2020.1b7, a new game object that is created (GameObject > Create Empty) is not positioned at 0,0,0. Was it always like this ??

    I compared it with 2018.4, and to my surprise the numbers were also non-zero (but different).

    upload_2020-5-3_22-15-3.png
     
  2. elliotfriesen

    elliotfriesen

    Joined:
    Mar 17, 2020
    Posts:
    71
    When you create a game object it does not always spawn at 0,0,0
     
  3. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,143
    Positioning of new GameObjects in the Editor depends on where your SceneView camera is looking.
     
  4. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,371
    It's also based on the current "focus size" of the editor - so if you focus a small object, and then create a new gameobject, the created thing will be closer to the camera than if you first focus something large.

    This all sums up to new objects never being in a position that's in any way useful.
     
    Doddler and LeonhardP like this.
  5. ivank

    ivank

    Joined:
    Nov 16, 2013
    Posts:
    106
    Imho the idea behind is that the author can always see right in the scene the object he has just created?
    Question of course remains, if is it really needed and if zero position would not be better...
     
  6. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,371
    Zero would probably not be very useful. The problem is that the object generally ends up below ground.

    There's some pretty decent functionality when you drag a prefab into the scene that places it on the ground under the mouse. Running the same code, but with the scene view's camera's center instead of the mouse pos would generally give better results.
     
    Doddler and ivank like this.
  7. Tidali

    Tidali

    Joined:
    Nov 24, 2022
    Posts:
    4
    I know it's a bit late, but you can force it to spawn at 0,0,0. Navigate through Edit > Preferences > Scene View and then at the top toggle "Create objects at Origin"!
     
    ZiggZagg37 and Rzeznik like this.