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
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
Well, MyActor->GetClass()
should work. Is that not giving you what you need?
GetActorOfClass
Or put all actor classes inside an index.
That finds an actor given a class, rather than finding the class of a particular actor.
could try
if (MyActor->IsA(AWeaponActor::StaticClass()))
In blueprints there’s a node called “get class”, under utilities
I spent ages trying to solve this as I have an array of actors with tag and want to spawn a random actor. So I needed to plug an actor into the class plug on SpawnActor.
It turns out all you need to do is plug your actor into the class plug and UE adds the conversion node…