Statement for with struct

is it possible to make a statement “For each” in blueprint with a struct type?

inside the struct all the data types are different from each other.

example:

Blueprint “Base” → this blueprint has 4 different child blueprint class.

struct → 4 child blueprint class of blueprint “base”

Not sure I follow, we may need a better explanation of what you’re attempting but you can definitely do this:

Each of the 3 pin classes here are a different child class inheriting from the same base class. The trick here is to ensure that the Make Array node is of base class first - then you can hook up any child classes.

First of all, your reference are not classes - they’re objects. Note the colour of the pin. It might be OK, it might not - depending on what you’re doing here.

Do re-read my answer:

The trick here is to ensure that the
Make Array node is of base class first

  • then you can hook up any child classes.

My example covers precisely this case:

“Rifle01” and “Rifle02” are different
child class of “BP_RifleBase”.

Ensure the array is of BP_RifleBase type, may it be an object or a class.

like that? or it better to make a
struct of class reference object?

That’s up to you. They serve very different purposes.

Class is a template for an object; while an object is an instance that exists in the word based on that class.

You can make an array of any of them. But a mixed array like that has to be of the type all children inherit from.

312957-capture.png

i want to make an array with “Rifle01” and “Rifle02”, the blueprint class of “Rifle01” is BP_Rifle01 and the blueprint class of “Rifle02” is BP_Rifle02, in this case i can’t.

“Rifle01” and “Rifle02” are different child class of “BP_RifleBase”.

like that? or it better to make a struct of class reference object?

understand.
thanks a lot!