Using c++ class in blueprints

I have costume c++ class that isnt supposed to be placed on the scene, only store some data. It is visible in blueprint, but i cant use it (reference is none). Creating reference doesn`t seems to create object, so my question is: how to construct instance of the costume c++ class in blueprints.

Yes, creating a reference doesn’t means you can use it, nullptr will be returned.

If your c++ class is a child of UObject, there is a blueprint function called “Construct Object From Class”, construct your c++ class and then set the returned reference the the reference you created in your blueprint.

If your c++ class is a child of AActor, thre is a blueprint function called “Spawn Actor From Class”.

To Construct an object from a c++ class, you need to use Construct Object From Class.

(Make sure you make your class Blueprintable in your header file.)

UCLASS(Blueprintable)
class MYPROJECT_API UMyUobjectClass : public UObject