UKismetGuidLibrary::IsValid_Guid
#include "Kismet/KismetGuidLibrary.h"
Access: public
Specifiers: staticBlueprintPureBlueprintThreadSafe
Description
Checks whether a GUID is valid, i.e. not the default all-zero value.
Caveats & Gotchas
- • A GUID only fails this check if all four internal components are zero — it does not verify that the GUID refers to any real object, asset, or registered identifier, only that it isn't the default-constructed value.
- • FGuid::NewGuid() is guaranteed to produce a valid GUID, but a GUID read from user input or deserialized data should be checked with this before use.
Signature
static bool IsValid_Guid( const FGuid& InGuid ); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| InGuid | const FGuid& | GUID to check. | — |
Return Type
bool Example
Guard against an unset GUID C++
FGuid PlayerId;
// PlayerId is default-constructed and invalid here
if (!UKismetGuidLibrary::IsValid_Guid(PlayerId))
{
PlayerId = UKismetGuidLibrary::NewGuid();
} Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?