- Home /
Unknown New Game Object in my scene?
I have just noticed that when my game runs, I have a New Game Object appear in my Hierarchy. It appears at the origin. I'm assuming that this is not normal- All the gameobjects in my game, but one, are either in the scene to begin with, or clones of objects in the scene. The only gameObject that is not in the scene beforehand, or cloned, is "stimulus_camera_target" which I create and is the target for the camera, and it is moving around in the scene constantly, while the "New Game Object" is stationary. Assuming this is not normal, I'd appreciate any suggestion as to how to begin to track down where that thing might be originating.
Can you see the game object in the camera view? Youre sure youre not instantiating it programmatically?
Answer by HellsHand · Apr 23, 2021 at 10:09 PM
Your code would help but to create an object like that programmatically it's as easy as GameObject obj = new GameObject();
, so double check your code for any lines like that. I've done this on accident thinking I could just add a GameObject
to obj later in my script, which I could but it doesn't get rid of the new GameObject that was created.
Thank you- I did a cntrl-F on "= new GameObject()" on the entire solution and found the bugger. I was also thinking that if you had GameObject ThisThing = new GameObject() it would show in the scene as "ThisThing", which had me confused about the appearance of "New Game Object" but that is not the case.