Download

FObjectInitializer::Get() can only be used inside of UObject-derived class

I get that exception when launching because of the class:


UCLASS()
class UgetUnrealDeltaTime : public UObject, public FTickableGameObject
{
	GENERATED_UCLASS_BODY()

	virtual void Tick(float DeltaTime) override { currDelta = DeltaTime; }
	virtual bool IsTickable() const override { return HasAnyFlags(RF_ClassDefaultObject) == false; }
	virtual TStatId GetStatId() const override { RETURN_QUICK_DECLARE_CYCLE_STAT(UgetUnrealDeltaTime, STATGROUP_Tickables); }

public:
	float currDelta;
};




UgetUnrealDeltaTime::UgetUnrealDeltaTime(const FObjectInitializer& ObjectInitializer) : UObject(ObjectInitializer)
{


}

It’s pretty clear I inherit from UObject so I don’t see how that exception pops up…