Could I please get a simple explanation of TSubclassOf

Thx @eblade for explaining that blueprints are actually subclassed from the c++ class and not an instance. I have two questions following on. As you say *“So when you specify TSubclassOf<AMyActor>, any valid value for that is any subclass of AMyActor, as well as any blueprints that are derived from any of those subclasses” *- So if I have two different blueprints BP_1 and BP_2 that have AMyActor as a parent (eg. two different weapon blueprints that have AWeapon as a parent) and I wish to only spawn BP_2 into the world how can I do that using TSubclassOf<AMyActor> when it seems to refer to everything subclass from AMyActor?

Second part of the question is - I still haven’t found a “right” answer to the “accessing values” inside of the AMyActor class. There probably isn’t a “right” answer - but keeping track of things like player/enemy health, enemy kills, bullets used - is that just best done in the blueprint itself?

Thanks.

1 Like