So my question is simple, i’m trying to create a ForEach that would create an instance of all types that belongs to a specific Parent type.
Example: “WeaponBase” and then “Pistol1”, “Pistol2”, “Pistol3” as child.
I would like to spawnActorFromClass, inside a foreach, similar to what GetAllActorsWithInferface would do, but instead of returning instances, I need to return the Type, so I can create the instance.
Is there a way to do this? I would not prefeer to harcode one by one the possible child types, I’d like the game to extend automatically when a new type is added.
Anyone having this similar issue where you want to get all child blueprint class assets rather than instances in the current world, here’s a solution that doesn’t require any C++:
Edit: This was done in 5.3 version. There might be differences in the AR filter, AssetData Struct or other nodes.
Edit+: Don’t use Async Load Class Asset node in a for loop, use Load Class Asset Blocking node instead. This was my bad. Async actions don’t work in loops (or maybe it depends on the situation?).