RealDocs

UBlueprintInstancedStructLibrary::IsValid_InstancedStruct

function Engine Blueprint Since 5.0
#include "Kismet/BlueprintInstancedStructLibrary.h"
Access: public Specifiers: staticUFUNCTIONBlueprintPure

Description

Returns whether the given InstancedStruct currently holds a valid struct value. Use this as a plain boolean check rather than the exec-pin branch version.

Caveats & Gotchas

  • This is the BlueprintPure sibling of IsInstancedStructValid — that one returns an EStructUtilsResult enum wired to exec pins ("Is Valid (Branch)"), this one returns a plain bool for use in expressions and conditionals.
  • An InstancedStruct is valid only if it has been initialized with a struct type via InitializeAs or Reset with a non-null StructType; a default-constructed InstancedStruct is not valid.
  • Does not verify the contents of the struct are meaningful — only that a struct type has been assigned and memory allocated.

Signature

static bool IsValid_InstancedStruct(UPARAM(Ref) const FInstancedStruct& InstancedStruct)

Parameters

Name Type Description Default
InstancedStruct const FInstancedStruct& The instanced struct to check.

Return Type

bool

Example

Guard before reading a value C++
if (UBlueprintInstancedStructLibrary::IsValid_InstancedStruct(MyInstancedStruct))
{
    const FMyStruct* Data = MyInstancedStruct.GetPtr<FMyStruct>();
    // use Data
}

Version History

Introduced in: 5.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.