Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Question Cant see gameobjects in game but they are visible at scene tab

Discussion in '2D' started by jonyp123, Dec 16, 2020.

Thread Status:
Not open for further replies.
  1. jonyp123

    jonyp123

    Joined:
    Nov 25, 2020
    Posts:
    8
    I created random spawn script with defined spawn points and have choosen enemy prefab, when i launch game enemies are appearing at "Hierarchy" tab (i mean that when u can find every game object on scene) and are visible when i click scene tab, but cant see them on game preview and on phone in unity remote when i launch it
     
    thiagosalvatore likes this.
  2. Derekloffin

    Derekloffin

    Joined:
    Mar 14, 2018
    Posts:
    321
    This usually means they are not visible to the camera in the scene. So check your camera position, in particular it's Z coordinate, relative to the z coordinate of the spawns. Use stuff in your scene that does show up as a reference for what should be visible. The other possibility is you have a sorting issue, like your background is in front of your spawns. That is less likely though as both scene and camera should show up the same there.

    Note you can preview what the camera sees without having to run, and while running you can mess with values in the editor to try and get something to show up. Just don't mess with the scripts themselves while running.
     
  3. jonyp123

    jonyp123

    Joined:
    Nov 25, 2020
    Posts:
    8
    but i can see sprites, they disappears only in game, when i click scene tab in game i can see them
     
  4. raarc

    raarc

    Joined:
    Jun 15, 2020
    Posts:
    535
    change your scene view to 3d view

    then activate gizmos

    then select your camera and double click

    now you should see a box that shows the view of your camera

    if your sprites are outside of that box then adjust the camera dimensions so they are inside it
     
    Izuen and Eozgungor like this.
  5. jonyp123

    jonyp123

    Joined:
    Nov 25, 2020
    Posts:
    8
    thanks af you are amazing
     
    raarc likes this.
  6. Gabriel_Ze_Creatorr

    Gabriel_Ze_Creatorr

    Joined:
    Jun 11, 2024
    Posts:
    1
    aaaaaaaaaaaa!!!!!! my 2d game object is not vissible in game view!!!!!! i did everything i saw on youtube and google but it didnt work!!!!!!
     
  7. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,761
    Welcome to the forums but please don't necropost threads.

    If you have a problem then create your own thread, explain your problem and what you've done to solve it. Your post contains no information regarding a problem nor any information that would allow others to help you.

    Also, please consider using the Getting Started forum which is more suited to such posts.

    Thanks.

    Thread Closed.
     
    Kurt-Dekker likes this.
Thread Status:
Not open for further replies.