Cannot set BP variable type to custom UObject class

I have a C++ class derived from UObject. Constructing (i.e. instantiating) and using that class in a level BP works fine, e.g. I can call the object’s methods. Now I wanted to save that object into a BP variable within the level BP.

However, that does not work as I thought, because I cannot set the new variable’s type to the custom C++ class. And if I set the variable’s type to Object, then I cannot cast that to the custom class. In both cases the name of my C++ class just does not show up in the list of possible variable types.

So what do I need to do in order to set the type of a BP variable to a custom C++ class derived from UObject?

Hey -

If you include Blueprintable and BlueprintType inside the UCLASS() macro you should be able to both create a blueprint based on your class as well as use the class as a type for variables inside blueprints.

Cheers

Thanks, that did the trick!