UKismetSystemLibrary::IsValidSoftObjectReference
#include "Kismet/KismetSystemLibrary.h"
Access: public
Specifiers: staticBlueprintPureBlueprintThreadSafe
Description
Returns true if the soft object reference is not null, i.e. it holds a non-empty asset path.
Caveats & Gotchas
- • "Valid" here only means the path is set — it does not mean the asset exists on disk or is currently loaded. Use LoadSynchronous or an async load to actually confirm and resolve the asset.
- • A reference to a deleted or moved asset still returns true from this check because the path string itself is non-empty.
Signature
static ENGINE_API bool IsValidSoftObjectReference(const TSoftObjectPtr<UObject>& SoftObjectReference) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| SoftObjectReference | const TSoftObjectPtr<UObject>& | The soft object reference to test. | — |
Return Type
bool Example
Guard before loading a soft reference C++
if (UKismetSystemLibrary::IsValidSoftObjectReference(MySoftRef))
{
UObject* Loaded = MySoftRef.LoadSynchronous();
} Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?