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 FLazyObjectPtr& Other
)

Construct from another lazy pointer

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 FLazyObjectPtr& Other
)

Copy from a lazy pointer

Public function

void

 

operator=

(
    const FUniqueObjectGuid& InObjectI...
)

Copy from a unique object identifier

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback