Hey guys,
I have a question regarding structures. Basically I have an Actor class called “Ability” and 3 children from it called “Ability Magic”, “Ability Melee” and “Ability Ranged”.
I created in “Ability” a method “Add Ability” for it to spawn an Actor of this class with the “Spawn Actor” node. I also have 4 UStruct called Ability, Magic Spell, Melee Attack and Ranged Skill. These structures are used to init the ability actors when spawned by exposing them in the actor.
What I want is to be able to pass any structure of the 3 structures to the “Add Abilty” method and pass it to the “Spawn Actor” node. When I tried to make the 3 Structures children of the Ability Structure, I still wasn’t able to plug it into the "Spawn Actor " node. I got a message saying that “derived structure are disallowed”.
Here is what my code looks like :
And in my blueprint, I want to avoid doing this and having multiple input which would require checking that the one selected in the ability info enum is indeed the one plugged in the arguments of the method “Add Ability” :
But When I try to plug directly one of the 3 children structure into the Ability info of the “Spawn Actor” node I got the error mentionned above.
Is there a way argument of varying type to a “Spawn Actor” node ? Or any other solution that doesn’t require checking ?
Thanks for the help