RealDocs

UKismetMathLibrary::Add_VectorInt

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

Description

Adds an integer to every component of a vector. Equivalent to Add_VectorFloat but accepts an int32, which Blueprint implicitly converts from an integer pin.

Caveats & Gotchas

  • The integer B is widened to double before addition, so large int32 values near INT_MAX will not lose precision, but the result FVector is still floating-point and subject to floating-point rounding.
  • In Blueprint, this node and Add_VectorFloat look identical on the canvas — the distinction only matters when connecting an Integer variable directly to avoid an implicit conversion node.

Signature

static UE_INL_API FVector Add_VectorInt(FVector A, int32 B);

Parameters

Name Type Description Default
A FVector The source vector.
B int32 Integer value to add to each component.

Return Type

FVector

Example

Shift grid position by a tile count C++
FVector TileOrigin = FVector(0.f, 0.f, 0.f);
int32 TileSize = 100;
FVector NextTile = UKismetMathLibrary::Add_VectorInt(TileOrigin, TileSize);

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.