Array of BP Classes (TSubClassof) - always empty
I been stuck on this issue for a couple of weeks now and I just simply cant get it to work the way I need it to. Basically a player picks the spells he/she wants to use, they get added to an array of Tsubclassof and I spawn the actors from said array (Spell Bar). I'm adding the spells using UMG/Blueprint but no matter what I do, the spellbar array is always empty. Mind you I can get the spells to cast under certain circumstances.
Here is the C++
In this situation, the spell does no cast. The only way to make it work is to Cast to FB class -> Set FBSpell. But I dont want to go this route as there will be 100s of spells, and the player will pick any at random.
In this scenario I can cast the spell by using the dropdown menu to find the FB class (Cant use a variable), but unless I use set spellbar, the add to spellbar method still produces an empty array. (I want to add conditions on add,thats why cant use a regular set spellbar).
So I finally fixed it for who ever gets stuck on this, pretty trivial thing to look over.
First I had to select default value for FB Class Object
Second I had to use GetClass() instead of StaticClass() to return the default class object, instead of an empty class.
answered May 05 '15 at 04:51 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here