RealDocs

TSoftClassPtr::Reset

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

Description

Clears the soft class pointer back to the null state, releasing both the cached weak pointer and the stored soft object path.

Caveats & Gotchas

  • Reset clears the path entirely — after calling it, IsPending() and IsNull() both reflect a fully empty pointer, not merely an unloaded one.
  • This does not unload the referenced class from memory; it only severs this pointer's reference to it.

Signature

UE_FORCEINLINE_HINT void Reset()

Return Type

void

Example

Nulling a soft class reference C++
UPROPERTY(EditAnywhere)
TSoftClassPtr<UMyAbility> AbilityClass;

void UMyComponent::ClearAbility()
{
    AbilityClass.Reset();
    check(AbilityClass.IsNull());
}

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.