I saw the following code in PaperSprite.cpp
Maybe I am totally missing something, but how can the check (BodySetup == nullptr) ever fail?
I know it is a GC system, but I don’t even see a reason to first set it to nullptr… NewObject sets the value anyways.
I ask this mostly to see whether my understanding of the GC is correct
void UPaperSprite::RebuildCollisionData()
{
UBodySetup* OldBodySetup = BodySetup;
// Ensure we have the data structure for the desired collision method
switch (SpriteCollisionDomain)
{
case ESpriteCollisionMode::Use3DPhysics:
BodySetup = nullptr;
if (BodySetup == nullptr)
{
BodySetup = NewObject<UBodySetup>(this);
}
break;