Hello everyone.
I m currently making a ability system, where the abilities (that are just a derived class of UObject ) are stored in a TArray so i can change them later and use them ingame.
This is the declaration, since i’m going to use different types of abilities, and I want to create Blueprints for each of them, I use the “tsubclass”, so I can assign them from the inspector view.
The problem comes when I try to do anything with the abilities stored.
First of all, If I try to call a public method of the ability class called “castAbility”, I cant, because when I access the array position with the “[ ]” operator, it is treated as a UClass item. But if I try to do a Cast before calling the method, the cast allways fails.
I ’ m not sure why I’m getting this errors, anything helps.
Thanks
Yeah sure, but the CastAbility method does nothing at the moment, except showing some text on screen:
This is the .h file
And this the cpp one
As you can see, nothing special. However I cant call it from the character, with the array.
Can you help me with it?