This is one of the NewObject overloads:
template< class T >
T* NewObject
(
UObject* Outer=(UObject*)GetTransientPackage(),
UClass* Class=T::StaticClass()
)
What I m a bit unclear on is whether Outer is the same as parent ? If i have two classes, A and B, and A is a container of multiple Bs, and Bs needs access to A as a parent, can I just use this Outer here to pass A as parent. Such as :
void A::CreateChild
{
B* child = NewObject<B>(this);
_children.Add(child); // _children would be a TArray or TMap
}
Is this the right use of Outer ? Any gotchas I should be aware of ?
Also - what is this GetTransientPackage() that the function defaults to ?