RealDocs

UKismetMathLibrary::Subtract_IntPointIntPoint

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

Description

Returns A minus B as a new FIntPoint, computed component-wise. Commonly used to compute the integer displacement between two grid positions.

Caveats & Gotchas

  • Integer underflow wraps silently — if A.X - B.X goes below INT_MIN the result wraps around to a large positive value.
  • The result is a signed displacement; to get an unsigned distance, call GetMax() or take the absolute value of each component separately after subtracting.

Signature

static UE_INL_API FIntPoint Subtract_IntPointIntPoint(FIntPoint A, FIntPoint B);

Parameters

Name Type Description Default
A FIntPoint The minuend IntPoint.
B FIntPoint The subtrahend IntPoint.

Return Type

FIntPoint

Example

Compute grid delta between two tiles C++
FIntPoint Target(7, 3);
FIntPoint Origin(2, 5);
FIntPoint Delta = UKismetMathLibrary::Subtract_IntPointIntPoint(Target, Origin);
// Delta == (5, -2)

Version History

Introduced in: unknown

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.