Home

UE4 Forward declare a TUniquePtr inside a UObject

If you have a UObject with a TUniquePtr of a forward declared type, you need to declare a special constructor as well as the destructor. Then define them in a cpp that has the needed includes.
For example see UBodySetup:

//UBodySetup.cpp
UBodySetup::UBodySetup(FVTableHelper& Helper)
: Super(Helper)
{
}

UBodySetup::~UBodySetup() = default;