RealDocs

UKismetMathLibrary::Vector4_Negated

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

Description

Returns a copy of A with all four components negated ({-X, -Y, -Z, -W}). Equivalent to the unary minus operator on FVector4.

Caveats & Gotchas

  • W is negated as well. If A represents a homogeneous point (W=1), the result has W=-1, which is not a valid homogeneous point. Use Subtract_Vector4Vector4(Zero, A) only on direction vectors (W=0) if you need to preserve homogeneous semantics.
  • This returns a new vector — A itself is unchanged. In C++ you can also write -A directly on FVector4 without calling this function.

Signature

static UE_INL_API FVector4 Vector4_Negated(const FVector4& A)

Parameters

Name Type Description Default
A const FVector4& The vector to negate.

Return Type

FVector4

Example

Flip a direction vector C++
FVector4 Forward(1.0, 0.0, 0.0, 0.0);
FVector4 Backward = UKismetMathLibrary::Vector4_Negated(Forward);
// Backward == (-1, 0, 0, 0)

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.