Navigation
API > API/Runtime > API/Runtime/CoreUObject
FLazyObjectPtr is a type of weak pointer to a UObject that uses a GUID created at save time. Objects will only have consistent GUIDs if they are referenced by a lazy pointer and then saved. It will change back and forth between being valid or pending as the referenced object loads or unloads. It has no impact on if the object is garbage collected or not. It can't be directly used across a network.
NOTE: Because this only stores a GUID, it does not know how to load the destination object and does not work with Play In Editor. This will be deprecated in a future engine version and new features should use FSoftObjectPtr instead.
| Name | FLazyObjectPtr |
| Type | struct |
| Header File | /Engine/Source/Runtime/CoreUObject/Public/UObject/LazyObjectPtr.h |
| Include Path | #include "UObject/LazyObjectPtr.h" |
Syntax
struct FLazyObjectPtr : public TPersistentObjectPtr< FUniqueObjectGuid >
Inheritance Hierarchy
- TPersistentObjectPtr → FLazyObjectPtr
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Default constructor, sets to null | UObject/LazyObjectPtr.h | ||
FLazyObjectPtr
(
FObjectPtr Object |
Construct from object already in memory | UObject/LazyObjectPtr.h | |
FLazyObjectPtr
(
const UObject* Object |
UObject/LazyObjectPtr.h | ||
FLazyObjectPtr
(
TObjectPtr< T > Object |
UObject/LazyObjectPtr.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| Super | TPersistentObjectPtr< FUniqueObjectGuid > | UObject/LazyObjectPtr.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void FixupForPIE
(
int32 PIEInstance |
Fixes up this FLazyObjectPtr to target the right UID as set in PIEGuidMap, this only works for directly serialized pointers | UObject/LazyObjectPtr.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void PossiblySerializeObjectGuid
(
UObject* Object, |
Called by UObject::Serialize so that we can save / load the Guid possibly associated with an object | UObject/LazyObjectPtr.h | |
static void ResetPIEFixups() |
Called when entering PIE to prepare it for PIE-specific fixups | UObject/LazyObjectPtr.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void operator=
(
FObjectPtr Object |
Copy from an object already in memory | UObject/LazyObjectPtr.h | |
| UObject/LazyObjectPtr.h | |||
void operator=
(
TObjectPtr< T > Object |
UObject/LazyObjectPtr.h | ||
void operator=
(
const FUniqueObjectGuid& InObjectID |
Copy from a unique object identifier | UObject/LazyObjectPtr.h |