Download

Spawning actor by name

Anyone have an idea how to spawning actor by name? I need to create an actor by user selection. I have thousands of actors. The only way I found it was Switch but doing it for thousands of actuaries is not wise.
Anyone have an idea???

Make an array of actors, then at least the player can choose from a list.

If you don’t want to sit there and populate the list, you can read the content folder using editor utility widgets, but I don’t know if they work in game. There are also plugins for doing that kind of thing.

Thank you, but it seems wrong to add an thousands of actors to array???

How about a Name | Soft Class Reference dictionary map:

For a 1k+ of something, it’s probably worth looking into at least a Data Table and use it to populate a dictionary map above; content of which, unlike a DT can be manipulated during run-time - if at all necessary, that is. One way or another, you’ve got some clicking to do.

Definitely Data Table… multiple data tables. Break the actors down into types/groups, for each group create a DT.