FLazyObjectPtr

[FLazyObjectPtr](API\Runtime\CoreUObject\UObject\FLazyObjectPtr) is a type of weak pointer to a [UObject](API\Runtime\CoreUObject\UObject\UObject) that uses a GUID created at save time.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

CoreUObject

Header

/Engine/Source/Runtime/CoreUObject/Public/UObject/LazyObjectPtr.h

Include

#include "UObject/LazyObjectPtr.h"

Syntax

struct FLazyObjectPtr : public TPersistentObjectPtr< FUniqueObjectGuid >

Remarks

FLazyObjectPtr is a type of weak pointer to a UObject that uses a GUID created at save time. 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.

This is useful for cross level references or places where you need to point to an object whose name changes often.

Constructors

Name Description

Public function

FLazyObjectPtr()

Default constructor, sets to null

Public function

FLazyObjectPtr

(
    const UObject* Object
)

Construct from object already in memory

Functions

Name Description

Public function Static

void

 

PossiblySerializeObjectGuid

(
    UObject* Object,
    FStructuredArchive::FRecord Record
)

Called by UObject::Serialize so that we can save / load the Guid possibly associated with an object

Public function Static

void

 

ResetPIEFixups()

Called when entering PIE to prepare it for PIE-specific fixups

Operators

Name Description

Public function

void

 

operator=

(
    const UObject* Object
)

Copy from an object already in memory

Public function

void

 

operator=

(
    const FUniqueObjectGuid& InObjectI...
)

Copy from a unique object identifier

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss