RealDocs

TSoftObjectPtr::Reset

function CoreUObject Since 4.17
#include "UObject/SoftObjectPtr.h"
Access: public Specifiers: inline

Description

Clears the soft object pointer to a fully null state, erasing both the stored soft path and the cached weak reference.

Caveats & Gotchas

  • Reset is not equivalent to assigning nullptr — nullptr assignment may leave the soft path populated depending on context; Reset guarantees that both IsNull() and !IsValid() are true afterward.
  • Calling Reset on a UPROPERTY-marked TSoftObjectPtr inside a CDO will propagate the null to all instances unless they override it in their own saved state.

Signature

UE_FORCEINLINE_HINT void Reset()

Return Type

void

Example

Clearing a UPROPERTY soft reference C++
UPROPERTY(EditAnywhere)
TSoftObjectPtr<UTexture2D> Icon;

void UMyWidget::ClearIcon()
{
    Icon.Reset();
    // Icon.IsNull() == true, Icon.IsPending() == false
}

Version History

Introduced in: 4.17

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.