Once a UObject* is GC’d, it is automatically set to null
This is not true for a UObject *
bare pointer, that doesn’t have the UPROPERTY
decorator.
If you make it UPROPERTY
then the UObject *
will keep the object alive.
To have a pointer to an object, which does not by itself keep the object alive, and gets set to null when the object dies, you need a TWeakObjectPtr<>
.