- Home /
GameObject can disappear 1 second after play, but still appear in scene window
I had a problem like this before for my other gameobject, I fixed it by duplicate another object and change its renderer to the gameobject i wanted. but this issues is weird, I don't have any animator in that 2D lights, it just suddenly dissapear after I hit play, but I can see it is still there in the scene window. It just like the camera does not want to render it, I don't understand
Answer by javiolvecal · May 04, 2020 at 05:18 PM
It happened to me in one of my proyects, in my case it was because the player at the start of the game move to the same Z coordinates that the camera, you don't see it because you have the 2D scene view. If you hit Play and select the 3D scene view in the inspector you can prove it.
In my case the problem was that the code of the movement moves the player there in the Start. I hope this helps you :)
this doesn't solve my problem tho, I can see it in the first 1 second after play, but then it dissapear even though the object is still there in scene window. There is no animator that might cause error like that, I don't know what else
Try to diseable the Player's components to see which causes the error. Or maybe is the camera who change it's Z coordinate to the same as player. If anything of this helps you, I recommend you to change the scene view to a 3D view when the error appears. This will hepls you to see where is the Player. I'm sure the problem is in the Z coordinate of something, because you can still seeing the Player in the scene view, rigth?
(Sorry about my bad English, I'm spanish)
Actually, I can fix it by duplicating my previous object and change the component 1 by 1 into the new game object which error. And it works fine... This makes me more confused, is it because scene in unity can't handle that many game objects? Because all I do I just duplicate the previous game object and make it into a new object and it works, but it not works if I create a new game object and make it into the game object I want, I must duplicate first