- Home /
Unwanted Cube GameOjbect gets generated upon playing any scene?
Hello Unity Community,
This is my first question and I have just begun unity game development, so please forgive me if I incur any formatting, rule, or otherwise any site violations.
Anyway, I am following one of the beginner tutorials, Beginner Fundamentals: Unity Game Dev Course, that takes you through developing a clone of the game "Swords and Shovels." It's a great course, and I would highly recommend it to other newcomers, however, I am having an issue with a Cube GameObject that is randomly being generated when I play any of my scenes.
Here is a screenshot
No matter what I seem to do, I cannot seem to correct this behavior. Once I stop the scene from playing, I delete the cube. However, once I play the scene again, the cube once again gets generated and shows up in the hierarchy. Something peculiar, if I rename this cube to say "RandomlyGeneratedCube" and then play the scene, it's name gets changed back to "Cube" once I play the scene. It appears in different places, there could be an order to where it appears, but I can't figure it out. It seems like its position is random.
I don't know what other information to include. I am a pretty experienced programmer, and I don't believe this Cube is being generated in any of the scripts (I mean that would be a difficult mistake to make accidentally you know?). Has anyone else experienced an issue like this? I possibly hit something unintended within the Unity Editor, I really just have no idea.
Any and all feedback is wanted and welcomed :)
Answer by unity_NRb1nS4sRjpFZg · Jun 15, 2020 at 04:35 PM
@robquinn Check your scripts to see if there is any "Instantiate" on them. if there is, go back to the tutorial and see if you need it. this is the most I can do without the scripts...
You know, I think you might be onto something. At one point, I was messing around with a Nav$$anonymous$$eshSurface and a Nav$$anonymous$$eshAgent, trying to get my character to move, and calling "Instatiate" was one of the things I can remember trying. I can't locate it now, but I think its probably related to that. I'm gonna wait and see if any other answers come in, but more than likely I'm going to accept yours. Thank you for the input! :)