RealDocs

UKismetSystemLibrary::IsValidSoftClassReference

function Engine Blueprint Since unknown
#include "Kismet/KismetSystemLibrary.h"
Access: public Specifiers: staticBlueprintPureBlueprintThreadSafe

Description

Returns true if the soft class reference is not null, i.e. it holds a non-empty class path.

Caveats & Gotchas

  • Only checks that a path is set, not that the class actually exists or is loaded — a reference to a renamed or deleted Blueprint class still returns true here.
  • Use LoadClassAsset_Blocking or an async class load to confirm the class actually resolves.

Signature

static ENGINE_API bool IsValidSoftClassReference(const TSoftClassPtr<UObject>& SoftClassReference)

Parameters

Name Type Description Default
SoftClassReference const TSoftClassPtr<UObject>& The soft class reference to test.

Return Type

bool

Example

Guard before loading a soft class reference C++
if (UKismetSystemLibrary::IsValidSoftClassReference(MySoftClassRef))
{
    UClass* LoadedClass = MySoftClassRef.LoadSynchronous();
}

Version History

Introduced in: unknown

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.