Do I need to free the pointers of subobjects created the "new" (4.8) way?

Hi,

I’ve seen that TSubobjectPtr has been deprecated. I goolged and found this (https://answers.unrealengine.com/questions/151857/how-to-update-tsubobjectptr-to-the-current-v46-cha.html) on what to do instead. However, nobody there mentions what happens to the pointer after the Parent is destroyed. Do I need to delete it manually?

Regards,
Lukas Wagner

And another thing: Where do I get FObjectInitializer from? Thanks

Hello, m3t4lukas

Please note that properties in Unreal Engine 4 are garbage collected if the following conditions are met:

  1. They are declared as a UPROPERTY;

  2. They point at UObject or UObject-derived objects.

As for FObjectInitializer, it comes as a parameter of constructor:

ACustomCharacter(const class FObjectInitializer& ObjectInitializer);

Hope this helped!

Good luck!

Hey, yeah, thanks it helped.

When I created a Pawn using the Wizard (It was the first and only time i’ve been using it, so it could be with other templates, too) the ObjectInitializer parameter has not been generated. So there only was a constructor with no parameters whatsoever. As long as I didn’t need it, it compiled just fine. Adding it manually was no problem, though.

Regards

Lukas Wagner