Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Scene View doesnt look like Game View

Discussion in '2D' started by bufuu, Feb 11, 2019.

  1. bufuu

    bufuu

    Joined:
    Jan 16, 2019
    Posts:
    7
    as the title says, my view looks different in scene than in my game view.
    the green square is a gameobject, the txt mesh pro text is its child.

    can you help me unity guys

    cheers :)

    i can give u further information and screenshoots if you need :)
    Screenshot (50).png game view
    Screenshot (49).png scene view
     
  2. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637
    @bufuu

    Hi - you didn't pretty much give any info except that "your scene looks different in game view".

    Your canvas / canvas scaler / anchoring setup for UI elements is not most likely setup properly (your text element placement shifts etc.).

    Scene view itself can't be used as any reference point, as your scene can show any part of 3d space.

    Just see how your elements line up relative to canvas, how you have setup the anchors. Try also changing to different aspect ratios and pixel resolutions, and see how your canvas looks in the scene view.

    I recommend you check the Learn section UI basics.

    Also, this is UI question not a 2D question.
     
    bufuu likes this.
  3. bufuu

    bufuu

    Joined:
    Jan 16, 2019
    Posts:
    7
  4. bufuu

    bufuu

    Joined:
    Jan 16, 2019
    Posts:
    7
    in my game view i use a resolution of 1280x720

    i know its different from my resolution of my canvas. i thought this is a know issue and there is an easy solution to it.
    button doesnt see to be on the right spot aswell...
    but every sprite is on the right place...
     
  5. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637
    @bufuu

    Sprites don't use canvas coordinate system, sprites are to be used in 3D world space.

    You have some setup for an Image created with RectTransform + SpriteRenderer?

    You should be typically using RectTransform + CanvasRenderer + Image.

    Is there some special reason you are trying to force Canvas system to use Sprites in Recttransform?

    Use Image instead and drop your sprite there.

    Also another note. I'm on 2018.2 so not sure about this one; but your Textmesh Pro looks different than the one from Package Manager. As you are using 2018.3 and I'm not, I can't say for sure, but the UI at least looks different. 1.2.4 has dark header bars your screenshots don't.

    Again, I recommend you check the Learn section UI basics.

    If you were to use Image / Button instead, your text (in green square) would have been properly placed and scaled.
     
    bufuu likes this.
  6. bufuu

    bufuu

    Joined:
    Jan 16, 2019
    Posts:
    7
    i used the greensquare object instead of a button to see if there would be same problems with a TMP as a child

    found the problem:

    i am using a script to change the camera size so the gameview shows the whole screen. as you said sprite and images use a different coordinate system.
    just added a script to the button, so they are still in place when i change the camera size

    ty <3