NewObject returns instance with wrong default values

If anyone’s also confused about this, the problem is the way NewObject is being called.

UBuildableEntity* building = NewObject<UBuildableEntity>(this, classVarThatIsSetInMyGamemode);

Should work. The first argument is always the outer.

1 Like