Spawn an actor from a specific string array

Hi there, so I have managed to make a system which takes in string values depending on what the player obtains. Is there any way to convert the string from the item i picked up, to a class which can be spawned in the world.

I have a main parent class which has loads of children, and i’m trying to make it so the child gets spawned if it is the first value in the string array, but i need it to be a class so i can plug that specific child in and make it spawn in the world.

Yes, like this

Or you could have the switch set a “class reference” variable instead of directly spawning the actor class, then merge all the “switch on” outputs after they set the “actor class” variable into one “spawn actor from class” node and plug in the class variable.

Here’s an alternative that might be more suited to something that has grown in size and helps minimise complexity a wee bit:

My Object Map is String | Actor Soft Class Reference:

275647-cap2.png

The only (?) downside is that it does not play nicely with variables exposed on spawn - but you can always fire a custom event after spawning the object.

That is much cleaner than my answer haha

Thankyou very much, this worked a charm!

Thankyou, i’ll try it!

Haha, I think you have a better alternative above, but thanks anyway :slight_smile: