UKismetMathLibrary::Subtract_VectorInt
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Subtracts an integer from every component of a vector. Primarily exists so Blueprint integer pins can connect without an explicit conversion node.
Caveats & Gotchas
- • Like Add_VectorInt, the int32 is implicitly widened to double — watch for sign extension on negative integers, which behaves as expected but can be surprising if you expected unsigned semantics.
- • Subtracting an integer modifies all three axes uniformly; if you only want to adjust a single axis, construct an FVector with zeros on the other axes and use Subtract_VectorVector instead.
Signature
static UE_INL_API FVector Subtract_VectorInt(FVector A, int32 B); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | FVector | The source vector. | — |
| B | int32 | Integer to subtract from each component. | — |
Return Type
FVector Example
Shift spawn point down by a whole-unit tile offset C++
FVector SpawnBase = FVector(500.f, 500.f, 200.f);
int32 HeightOffset = 50;
FVector Adjusted = UKismetMathLibrary::Subtract_VectorInt(SpawnBase, HeightOffset); Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?