x

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"

Basic Question about initialization

Hello

My question is a pretty basic one, I'm just a bit confused about the difference between

 TSubclassOf<class ASpell*> spell;
 TSubObjectOf<class ASpell*> spell;
 ASpell* spell;

and how those work.

I have a class named Spell with an inheritance from Actor.

in my Character class, I want to have a item of that class, and modify his attributes (damage, range...etc).

so in C++ I usually would do something like that:

 ASpell* spell = new ASpell();
 
 spell->SetDamage();

But here in unreal, I read about doing something like:

 TSubclassOf<class ASpell*> spellQ;
 spellQ =  ASpell::StaticClass();
 spellQ->SetDamage();

but that makes spellQ a Uclass item, that obviously can't access to ASpell* functions.

Which way is the right one to create the item that I want? and how can I do it properly?

Thanks very much

Product Version: Not Selected
Tags:
more ▼

asked Oct 14 '14 at 03:46 PM in C++ Programming

avatar image

Grendert
13 5 14 12

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

0 answers: sort voted first
Be the first one to answer this question
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