UKismetMathLibrary::Vector_AddBounded
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticBlueprintCallable
Description
Adds InAddVect to A in place and then clamps the result to an axis-aligned cube of half-size InRadius centered at the origin. Combines addition and bounding in a single call.
Caveats & Gotchas
- • Modifies A in place via a ref parameter — the original value is lost. If you need the pre-add value, copy it first.
- • The clamp is applied to A + InAddVect as a whole, not per-add-step. Very large InAddVect values can jump A to the cube boundary in a single call. If you need incremental clamping, call this multiple times with smaller increments.
Signature
static ENGINE_API void Vector_AddBounded(UPARAM(ref) FVector& A, FVector InAddVect, float InRadius); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | UPARAM(ref) FVector& | The vector to modify in place. Result is clamped to the cube after addition. | — |
| InAddVect | FVector | The vector to add. | — |
| InRadius | float | Half-size of the cube bound applied after addition. | — |
Return Type
void Example
Accumulate impulse with a speed cap C++
// Accumulates per-frame impulse but caps total stored impulse
UKismetMathLibrary::Vector_AddBounded(AccumulatedImpulse, FrameImpulse, MaxImpulseRadius);
// Later apply AccumulatedImpulse to physics body Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?