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?

Did you add the BlueprintType specifier to the object’s UCLASS declaration?

Thanks, that did the trick!