Uproperty Class Variable

Hi everyone
in my game I have an object, where I want to be able to select in the editor which object to spawn when a player hits the object. Imagine like in Super Mario when he hits a block from the bottom either coins or a powerup appears, and I want to be able to edit this after I placed the object in the world.
So I decided to make a Variable for this in the BluePrint (see the attachment pic) and everything is working as I want.

But now I want to use a cpp variable as a UPROPERTY but when I take “class AActor* …” I can only choose between actor references I already placed in my level but I want to choose between general blueprints I have made.

So my question is: How do I get an “Actor Class Variable” and not a Reference?

TSubclassOf<AActor> is what you need.

2 Likes

Thank you very much Sir! :cool: