RealDocs

UKismetMathLibrary::Negated2D

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

Description

Returns a copy of the 2D vector with both components negated (-X, -Y). Equivalent to multiplying by -1, used to reverse a 2D direction.

Caveats & Gotchas

  • Returns a new FVector2D — the input is not modified. This is unlike some mutable 'Negate' methods on other types.
  • In Blueprint this maps to a ScriptOperator 'neg', so it appears as a unary negation node rather than a two-input operator.

Signature

static UE_INL_API FVector2D Negated2D(const FVector2D& A);

Parameters

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

Return Type

FVector2D

Example

Reverse a scroll delta C++
FVector2D ScrollDelta(0.f, 10.f);
FVector2D Reversed = UKismetMathLibrary::Negated2D(ScrollDelta);
// Reversed = (0, -10)

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.