Download

Dynamically allocating UUserDefinedStruct?

It seems when I try to dynamically allocate a UUserDefinedStruct I get the following error:

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

This is what the code looks like:

UFUNCTION(BlueprintCallable)
static bool LoadSequenceTransforms(const FString& sequenceName, TArray<UeKeyedTransform*>& transforms);

bool USequenceSaverFunctions::LoadSequenceTransforms(const FString& sequenceName, TArray<UeKeyedTransform*>& transforms)
{
UeKeyedTransform* transformStruct = new UeKeyedTransform();
}

If I can’t use new on it, how do I dynamically allocate it then?

Apologies if the formatting for the code is messed up - not exactly sure how to format (new to the forums).