Search Unity

Question Sprite/Shape Not Appearing on Layout of 2D Game

Discussion in 'UGUI & TextMesh Pro' started by Pike86, Jan 10, 2024.

  1. Pike86

    Pike86

    Joined:
    Jun 12, 2021
    Posts:
    1
    Hello, everyone! I'm sure that this is an absurdly simple issue, but I cannot seem to find a solution for it here in the forums, on YouTube, through ChatGPT, etc. I appreciate any input or expertise that you can share! Thanks in advance.

    Overview
    I'm just getting acquainted with Unity and am experimenting with clicking buttons and updating text. My layout seems to be fairly simple; it's a Canvas containing some TMP text and buttons, and a single Sprite, a green square.

    In Scene Mode
    My TMP buttons and TMP text is visible, as is the green square. Anytime I have the option to assign an [Order in Layer] or [Sort Order] in the inspector for these items, I leave it at the default 0.

    In Game Mode
    When I enter game mode, I see the following:
    - My standard Blue background (set in the inspector for the 'Main Camera');
    - My buttons and text

    Issue
    My green square is not visible in Game mode, despite being placed within the boundaries of (what I understand to be) the Canvas.
     

    Attached Files:

  2. DanielTanBK

    DanielTanBK

    Unity Technologies

    Joined:
    Aug 20, 2019
    Posts:
    82
    Hello, are you still having this issue?
    Do check the Render Mode of your Canvas, if it's in Screen Space it would render within the bounds of the camera (highlighted in red from your screenshot) during Play Mode and not according to the Scene View display, else you can switch to World Space to have it behave like the actual object in the Scene View

    More info on the Canvas Render Modes can be found here:
    https://docs.unity3d.com/Packages/com.unity.ugui@2.0/manual/UICanvas.html

    opera_moQQitbNrf.png