UKismetMathLibrary::Add_Vector2DFloat
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Adds a scalar float to both components of a 2D vector, returning (A.X + B, A.Y + B). Use when you need to uniformly offset a 2D coordinate.
Caveats & Gotchas
- • The scalar B is added to both X and Y equally — it is not a per-axis operation. Use Add_Vector2DVector2D if you need different offsets per axis.
- • The parameter is declared as double in the header (UE5 double precision), but Blueprint treats it as a float pin.
Signature
static UE_INL_API FVector2D Add_Vector2DFloat(FVector2D A, double B); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | FVector2D | The vector to add to. | — |
| B | double | The scalar value added to both X and Y components. | — |
Return Type
FVector2D Example
Add uniform padding to a UV coordinate C++
FVector2D UV(0.1f, 0.2f);
FVector2D Padded = UKismetMathLibrary::Add_Vector2DFloat(UV, 0.05);
// Padded = (0.15, 0.25) Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?