Instantiation Naming - ' "originalName" + (clone) ' vs ' "originalName" + i ' - feature request

This could be as an option flag or just a plain old change of method but I’m curious how many people really want a bunch of same named clones running, rolling, or sitting around. Its not a big deal to add a iteration to the end of their name, but I can’t help feel a little stupid removing the clone part of their name before adding a number. If instantiating something, there’s a good chance that the original isn’t in the scene, so they are all clones, it seems a little redundant to tack clone on to their name, it would be great if instead of tacking clone on to the prefabs name it were a number. If there does happen to be an original in the scene then that one just doesn’t have a number.

1 Like

Even though it might sound like a good idea on the outside, tracking the index for each prefab is going to be an unnecessary overhead in the instantiation process. So I don't think they ever add such a feature.

As an alternative, you can always set the name of your object after instantiation:
clone.name = prefab.name + " " + index;

In my use case I am instantiating clones one at a time and then immediately adding them to a list, before adding them to a list I am removing the clone part of their name by renaming them. While a list does all the numbering I need, I think it would be nice to have a say in how the instantiatees are named.

Instantiate - Could return instances with prefab.name
InstantiateClone - Could return instances with prefab.name + "(Clone)"
InstantiateIndexed - Could return instances that are indexed

Why do you want Unity to do this, instead of doing this yourself?

You can instantiate and then immediately set the name.