.h
UCLASS(Blueprintable) class USingletonBP: public UObject { GENERATED_UCLASS_BODY() /** * Singleton access */ static USingletonBP* Get(); };
.cpp
USingletonBP* USingletonBP::Get() { static USingletonBP* Singleton; if (!Singleton || !IsValid(Singleton)) { UClass *SingletonClass = LoadClass<UObject>(NULL, TEXT("/Script/ModuleName.SingletonBP"), NULL, LOAD_None, NULL); Singleton = (USingletonBP*) ConstructObject<UObject>(SingletonClass); } return Singleton; }