function running twice on start

So, what I’m doing is creating a clone of an object at the start of my game. When I call the function at Start() it creates 2 clones for each function call(i.e. if I call the function once, I get 2 objects; if I call the function twice, I get 4 objects; etc…). I put in a log message to confirm that the Start() function isn’t running twice, and if I don’t run the function at Start() no objects are created at all. I also run the clone function on a trigger, and it only creates one copy of the clone there, which leads me to believe it isn’t the clone function. I’m not sure where else to look, or what might be going on here. Any suggestions on what might be the problem or what I can do here?

Is the clone script placed on the object you are cloning?

No, but that made me realize that it was attached to the background object which is being created twice! I just have something else calling the function, and I’m getting the correct number of objects. But, now I’m confused as to why it was creating 2 cloned objects, but not outputting the Debug.Log() twice as well. Any ideas why that is? (It’s not particularly important, but I’m curious now.)

It could be you have your console set to “collapse” (a button at the top of the console window), which will only show one instance of non unique messages.

Ahh, that would likely be the root of the issue… Thank you!

You’re welcome :slight_smile: