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.

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,561
    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,111
    Positioning of new GameObjects in the Editor depends on where your SceneView camera is looking.
     
  4. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,224
    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:
    100
    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,224
    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.