Fill and array with object's childs

Hello guys,

I’ve several spells that inherit from a parent class. I’m looking to access to all of them and fill an array with it.
They are not actors placed in the world.

I found a way by creating object with “Construct object from class” and fill the array one by one.
If it’s possible i’d like to do this a

dynamic way.

Hi, thank you for your answer.
I may have expressed myself poorly but i need to load differents classes.

Your solution simply alow to load many times the same class.
Let’s say i have a parent class and many children, i want to load all the children.

Hi, thank you for your answer.
I may have expressed myself poorly but i need to load differents classes.

Your solution simply alow to load many times the same class.
Let’s say i have a parent class and many children, i want to load all the children.

Try it like this:

This will add 5 object to the array.

You’re not very descriptive regarding what you’re trying to achieve - sort of impossible to guess what you need,

Maybe this, maybe not:

For example:

i want to load all the children.

What does it even mean? Where are you loading them from? From a save game? What is all here - 1 of each subclass? Place children into separate arrays?

To be understood i’ll try to explain the context.
I want to display a widget for each spell (i think they have to be actors) in a menu like a grid panel.

The player select like 5 out of 50 for exemple.

I need to place blueprint classes (spells) in a first array to display widgets and then a second array after the player selection.

One array for all the spells wich are blueprint actors.

I hope to have been clear.

I have to add actors one by one? There is no way to do this in a dynamic way?
Each child actor i’ll create i’ll have to add it in the parent class?

Of course not. I’ve suggested 2 methods already, both create and place new objects in arrays, dynamically.

I need to place blueprint classes
(spells) in a first array to display
widgets and then a second array after
the player selection.

So now we have many arrays. :slight_smile: The plot thickens!

I don’t understood what’s stopping you from doing what you’ve just described. Spawn an actor of the class you want and add it to an array of parent type. You can then append arrays once you’re ready with the selection.

You have to name each actors in the select node, what i’m looking for is call them all!

Yours methods make me edit the parent blueprint each time i want to create a new child actor.

I didn’t focus on the fact that the number of actor is scalable(I’ll often add new spells).

So like create one of each? You can create an array of classes. Iterate through it in a loop and instantiate one of each class.

If you’re looking for a node that will automagically pick up something you’ve created in the Content Browser, no dice.

Mmmh… That was kind of what i was looking for.
Thank you very much your help was very welcome and at least you open my eyes !

(I’ll use something close to your second solution).