Can you reset name generator for spawned actors?

So let’s say im spawning actors called “enemy” and ofc every time you spawn one the naming goes like “enemy1”, “enemy2”, “enemy3” and so on. Now let’s say i spawned 100 of them so i have names from “enemy” to “enemy99” and i decided to destroy all those actors so there are no actors left but the name generator doesnt know that so even though i have 0 enemies and i start spawning new ones now the names start from “enemy100” and i dont want that… I want to reset it after i kill all the actors. Is there even a way to do so or i just have to stay triggered every time i look at actor names? :slight_smile:

This is related to how FName variable, which is special string format which tracks all the names and create hash table allowing to do faster name seeking, the names are actully stored as string and number in blueprint you see it as type “Name” and pin color is purple. Setting actor name with number 0 (or string without a number) might make FName reuse old numbers, problem is by first glance you cant rename actor in blueprints, only C++ or manually in world outliner.

There’s a node called ‘Set Actor Label’. That changes the name you see in the WorldOutliner. But then, you have to keep track their number to append to the label since actors can share the same label and using ‘Set Actor Label’ will drop the system generated ID.

This works, not as clean as i would want it to be but it’s better than having some silly names like enemy23452 even though you have only 5 enemies on the screen