UKismetSystemLibrary::IsValid
#include "Kismet/KismetSystemLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Returns true if the object is usable: non-null and not pending kill / garbage. This is the function behind Blueprint's 'Is Valid' node.
Caveats & Gotchas
- • This is a thin wrapper around the global ::IsValid(Object) function — in C++ prefer calling ::IsValid() or IsValid(Object) directly rather than the fully-qualified UKismetSystemLibrary version, which exists mainly so Blueprint has a node to call.
- • A pointer that is non-null can still fail this check if the object is pending kill/garbage-collected; conversely `Object != nullptr` alone is not a safe validity check in UE — always use IsValid instead of a raw null check for UObjects.
Signature
static bool IsValid(const UObject* Object) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| Object | const UObject* | The object to check. | — |
Return Type
bool Example
Guard against invalid objects before use C++
if (UKismetSystemLibrary::IsValid(TargetObject))
{
TargetObject->DoSomething();
} Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?