Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Array of BP Classes (TSubClassof) - always empty

Hi guys,

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.

  • know add to spell is not connected, it is just for demonstration purposes, I have tested it with BeginPlay, etc.

  • tried added defaultobjects but that also didn't work.

Here is the C++ alt text

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. alt text

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). alt text

Thank you,

Product Version: Not Selected
more ▼

asked May 03 '15 at 04:52 AM in C++ Programming

avatar image

129 10 11 15

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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 alt text

Second I had to use GetClass() instead of StaticClass() to return the default class object, instead of an empty class. alt text

more ▼

answered May 05 '15 at 04:51 PM

avatar image

129 10 11 15

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question