Svend Hansen
Svend Hansen

Reputation: 3333

Why can I not choose my UObject class as a parent for a blueprint

I had a blueprint with parent class Object which I needed to reference from C++, so I needed to create a C++ class extending UObject, defining some of its fields and methods in there and reparenting my blueprint to this new class. It took me ages trying to work out why I couldn't choose this new class as my parent class in the blueprint, until I accidentally fell over the solution in my IDE. Since I hadn't found this anywhere on the internet, I thought I'd post a Q&A style post here for anyone else with the same issue.

Upvotes: 1

Views: 3553

Answers (1)

Svend Hansen
Svend Hansen

Reputation: 3333

Add Blueprintable to the class's UCLASS macro, like this:

UCLASS(BlueprintType, Blueprintable)
class MYPROJECT_API UMyClass : public UObject

The doc for this macro parameter reads:

Blueprintable (Unreal Engine reflection specifier) Exposes this class as an acceptable base class for creating Blueprints. The default is NotBlueprintable, unless inherited otherwise. This Specifier is inherited by subclasses.

Upvotes: 3

Related Questions