Store Class Type in Blueprint variable ?
I need to store multiple different Blueprint-Actor-Classes in an Array, and spawn an instance of them on demand. Is that possible ? What type of array do I need ?
asked Aug 08 '14 at 01:11 AM in Blueprint Scripting
The answer is: You can just use class'Object' as type and put in any class you want. It will still spawn an object of the correct class.
answered Aug 11 '14 at 12:47 PM
The purple class variable stores classes. But anytime I plug such a variable into a Spawn Actor node for the class it bugs out on me, so I don't know how it is supposed to work.
Anyway you can do it manually on the spawn actor node without the class if you run into problems with the variable as I have. Try the variable first though.
answered Aug 08 '14 at 06:35 AM
Maybe a little late but still :
1/ Left click your array's icon in My Blueprint / Variables Tab
2/ Type "actor"
3/ In suggestions, point "Actor" with mouse.
4/ Choose the "Class" line in the drop-down menu that appears on the right. (purple icon)
To spawn an element : AddChildActorComponent node -> plug a SetChildActorClass node from ReturnValue Pin, and whatever element of your array you want in the "InClass" pin of this same last node.
answered Apr 22 '18 at 03:22 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here