Issue with adding an actor component to actor due to variable type

(this blueprint is inside of a userwidget blueprint)
Basically I have an array inside of a blueprint containing actor components, the variable type is Object.


I intend for one of them to be added to the player, in this blueprint this is Selected Upgrade

As I need the actor component class I attempted to use get class for this, but it came up with:

At first I try to cast this upgrade to an actor component, as well as to the upgrade template parent actor these upgrades are built from, but on both of these the cast fails.
I then attempted to change the kind of variable used in this blueprint, so that the variable type would match the one needed to add it to the player.
However, doing this removed the actor components from the table and did not allow me to add them back. I have tried many different variable types but the only one that lets me add the actor components to the array is Object, which as mentioned earlier will not work for this.
Help! I have no idea what else to try to get this to work.

The Available Upgrades array’s type should be (Soft) Actor Component Class or base class of the upgrade component.

Same goes for Selected Upgrade.

1 Like

thank you! that worked the actor components are now being added to the player
i am facing one problem with the class not being removed from the available upgrades array but i will make a new topic for that if necessary

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.