I was wondering how I could get different bp actors (lets say some differen types of door Blueprints and different types of Pickup bp’s) inside my construction script. The only way I got it to work so far is via drag and drop from the asset library in my construction script, I wonder how I would get them in via the actions menu in blueprint, also I would like to have them put in an array to choose them randomly afterwards, like I do it with “add static mesh” too.
At the moment I am randomizing what child actor to choose with lots of branches and random bools in it, and via drag and drop catched child actors… that feels uber wrong!
Thanks for your fast reply! You mean like this? Cause this also does not work… i think my Problem is even earlier in the process, I dont get the child actors inside my construction script, only via drag and drop. I tried object reference variable etc. But when i try to use the node “add child actor” it does not work, only the on drag and drop generated “add child actor” nodes work
BUT I would like to set it up from an array. when I Plug the exact same actor in the target slot of the add child actor node it does not work anymore. My Goal would be like described above choose some actors and make an array from them ( that allready works) and plug them into the add child actor node, but for some reason this does not work.
HAH: yes Problem is I dont know how to add random child actors from array.
yes, Building the array works, the add child component node does not work anymore when i plug it in, evenwhen i plug in the same actor reference what i had choosen in the details drop down it stops working… nor as single object reference nor from array.
Like i said, when i choose the actor in the drop down in the details panel (you can see it on the right in the attachment) it works as expected. So I thought in construction script this is the way to add my actors instead of “spawn actor from actor from class” I use spawn actor in event graph, but here in construction script there is no option for that. I need to find a way to change the class of the add child actor component node.
I think there is some terminology confusion here, like you can see in the last attachment, there is no “spawn actor” in construction script. And “add child actor component” works when the actor is selected in the “child actor class” drop down, the problem was that i cannot acces this in the graph… But I found a workaround, instead of putting references of actors in an array to put them randomly in the child actor class slot of the add child actor component node. I now just added a add child actor component node per object i want to add (or spawn ;)) and use a switch on int node to randomize it.
In case anyone is still checking this thread, it definitely CAN be done. In my construction script I have an array of classes (Main Equipment C) which I want to become child actors. I add them using the a “ForLoop” and “Add Child Actor Component” node and then add the output of that node to an array of child actors (Main Equipment A), and immediately after “Set Child Actor Class” from my Array of classes.
Then in my event graph, when I need to trigger something on one of my child actors, I get it from my Main Equipment A array of child actors, and then “Get Child Actor” in order to get the reference I need to do it.