I am trying to make clones of a game object and change the name every time they are created but I can’t find a good way to do it.
This is the part of my code that I am having a problem with:
GameObject b = GameObject.Instantiate(bullet, muzzle.position, Quaternion.identity) as GameObject;
I wish I could do this:
number = number + 1
GameObject “b” + number = GameObject.Instantiate(bullet, muzzle.position, Quaternion.identity) as GameObject;
This does not work with C# but if I can do this, I can stop objects from being the same name.
If there is a way to change the name right after the object is cloned, it is also fine.
I solved this problem! I had moved the scenes to another folder and I think thats what was breaking it. All I had to do was delete all the scenes in the build settings, and put them back in and then it worked fine
– caulfield85