Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Enter the 2020.2 Beta Sweepstakes for a chance to win an Oculus Quest 2.
    Dismiss Notice

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

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    5,091
    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:
    46
    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:
    5,091
    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.
unityunity