Hey! I was wondering is it possible to drag/assign a default value for variables within a blueprint? For example I have this array of ChildActorComponents:
And I’d like to assign these ChildActorComponents directly into them so they’re in a specific order, rather than do it through code/blueprints or after placing it in a level as they’re spawned during runtime.
Is that possible at all? I’ve tried searching around and can’t seem to find an answer.
for things like this you can use the construction script (this is the blueprint version of the C++ constructor for the class with “some limitations”) where you can feed them into the array, in the order you want, or get all the children of a specific class. this has additional value because the construction script is also run every time there is a change to the instantiated object in the Level (while in the editor)
so if you don’t want to feed them in manually in the construction script you can get all the child actors, at that point your only problem would be sorting (when anytime you do a get that returns an array it has a chance to be randomly ordered. this is where you will either need a “blueprint array sort” (I believe the is one in one of the free extended blueprint libraries), go into C++ to sort the array (by lambda or predicate), or create an editor utility so you can manually re-order the array in the editor.