Duplicates of prefab appearing out of nowhere
Whenever I run the game, six duplicates of one specific prefab get created, except with all the mesh renderers disabled.
I've made a copy of my scene with every object deleted from the hierarchy so that it's completely empty. I've also run this script and deleted all hidden duplicates from the scene, leaving me with one entirely void scene. Yet when I hit play, the same six duplicates are created at the same point, the world origin before spreading out due to their 2D colliders and 2D rigidbodies. They also all have the same exact name, rather than "Name (1)", "Name (2)", etc.
Why should this be happening? If my scene is entirely empty, where are these duplicates coming from? This stops happening when I restart Unity until it happens again anywhere from 1 minute to 8 hours later. Every time this happens it causes my game to break because scripts trying to access the main prefab are instead finding all these duplicates.
I've just created a new scene. Pressing play still causes the same thing, despite me having neither added to nor changed the scene in any way after hitting File > New Scene. This leads me to believe it's almost certainly a Unity bug, but I still would like to know what I can do to stop this from happening, other than just abandoning the entire game or restarting Unity every few $$anonymous$$utes.
Alright it now happens every time I load my original scene. Then it proceeds until I restart and go into a blank project. So I can't work on my game at all at the moment. :(
Your answer
Follow this Question
Related Questions
Changing a Prefab's Text component seems to be broken. 1 Answer
How do you set Prefabs into a GameObject array that will activate/deactivate when called? 1 Answer
How to creating a Gameobject from a prefab via scripted UI BUTTON 1 Answer
Create gameobject in other scene... 0 Answers
Drag and Drop 3D objects. 0 Answers