Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Why can't I see my Game Objects?

Discussion in 'Scripting' started by tomlugin100, Dec 3, 2023.

  1. tomlugin100

    tomlugin100

    Joined:
    May 6, 2023
    Posts:
    79
    Hello everyone and thank you for reading my post,
    I wasn't sure if this is the right place in the forums for this question. Feel free to move it to a better location if you see fit.
    I'm working on a 2D game and I gave all my objects a z-coordinate of 0. None of them show up on the Game View screen anymore. All I see is my Camera's background color.
    Why can't I see any of my Game Objects? Thanks for any help
    Humbly,
    Tom
     

    Attached Files:

    Last edited: Dec 3, 2023
  2. Lenakeiz

    Lenakeiz

    Joined:
    Jun 11, 2015
    Posts:
    34
    We don t have much information to help you here, but I am going to assume that you are talking about GameObejcts set in the World space and not UI elements.

    There is a combination of camera properties and setting that I would check. Each camera has a cnar and far clipping planes determining the range in which objects are visible. If your objects are placed outside this range (too close or too far from the camera), they won't be displayed. Make sure the camera is looking towards the objects. For 2D, the camera should be looking down the Z-axis. Try to move the camera from the scene at runtime to make sure is looking towards the objects.

    These are less likely but just in case. Game objects can be on specific layers and cameras can be set to render only specific layers by setting the culling mask. I am assuming this is set correctly.
     
    Bunny83 and tomlugin100 like this.
  3. tomlugin100

    tomlugin100

    Joined:
    May 6, 2023
    Posts:
    79
    Thank you for your answer @Link0n3 . Changing the clipping planes did the trick. My objects weren't visible to the camera
     
    Lenakeiz likes this.
  4. Lenakeiz

    Lenakeiz

    Joined:
    Jun 11, 2015
    Posts:
    34
    Glad it worked!
     
    tomlugin100 likes this.