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"

Get class of actor?

Is there a way to get the class of an AActor except for manually casting it to every single subclass, nor enumerations with the type of the actor as a variable?

I need this for my inventory system

Product Version: UE 4.8
Tags:
more ▼

asked Nov 21 '15 at 08:24 AM in C++ Programming

avatar image

Dirt113
95 12 15 21

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

3 answers: sort voted first

Well, MyActor->GetClass() should work. Is that not giving you what you need?

more ▼

answered Nov 21 '15 at 11:43 PM

avatar image

Sneftel
475 21 21 40

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

could try if (MyActor->IsA(AWeaponActor::StaticClass()))

more ▼

answered Nov 23 '15 at 09:48 AM

avatar image

DivideByZero
8 2 3 5

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

GetActorOfClass

Or put all actor classes inside an index.

more ▼

answered Nov 22 '15 at 12:51 AM

avatar image

nmm131
170 47 49 60

avatar image Sneftel Nov 22 '15 at 01:39 AM

That finds an actor given a class, rather than finding the class of a particular actor.

(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