UKismetMathLibrary::Multiply_VectorFloat
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Scales a vector uniformly by a scalar float, equivalent to A * B on each component. The standard way to scale a direction vector to a desired speed or length.
Caveats & Gotchas
- • Multiplying by 0 produces a zero vector — if this result feeds into a GetSafeNormal() call, you will get FVector::ZeroVector back, which can silently cause no-op movement or rotations.
- • Multiplying by a negative scalar reverses the vector direction. This is sometimes intentional (e.g. building an opposite force) but easy to introduce accidentally when chaining operations.
Signature
static UE_INL_API FVector Multiply_VectorFloat(FVector A, double B); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | FVector | The vector to scale. | — |
| B | double | Scalar multiplier applied to all components. | — |
Return Type
FVector Example
Scale a normalized direction to a launch speed C++
FVector Direction = (TargetPos - SourcePos).GetSafeNormal();
float LaunchSpeed = 1500.f;
FVector LaunchVelocity = UKismetMathLibrary::Multiply_VectorFloat(Direction, LaunchSpeed); Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?