RealDocs

UKismetMathLibrary::NotEqual_ObjectObject

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

Description

Returns true if A and B are different UObject instances (pointer inequality). This is the Blueprint != operator for object references.

Caveats & Gotchas

  • Like EqualEqual_ObjectObject, this tests pointer identity only — two distinct objects with identical data are considered not equal.
  • A common use is `NotEqual_ObjectObject(Ref, nullptr)` as a null check, but prefer IsValid() for that since IsValid also catches pending-kill objects that would pass a null check but are unsafe to use.

Signature

static UE_INL_API bool NotEqual_ObjectObject(class UObject* A, class UObject* B)

Parameters

Name Type Description Default
A class UObject* First object reference to compare.
B class UObject* Second object reference to compare.

Return Type

bool

Example

Skip self-damage C++
if (UKismetMathLibrary::NotEqual_ObjectObject(DamagedActor, InstigatorActor))
{
    ApplyDamage();
}

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.