UKismetMathLibrary::Multiply_VectorVector
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Multiplies two vectors component-wise, returning {A.X*B.X, A.Y*B.Y, A.Z*B.Z}. Used for non-uniform scaling or masking individual axes.
Caveats & Gotchas
- • This is NOT the dot product or cross product — it is a Hadamard (element-wise) product. Use Dot_VectorVector or Cross_VectorVector for those operations.
- • Masking an axis to zero (e.g. B = FVector(1,1,0)) is a common idiom to project a vector onto a plane, but it only works correctly in world space; results are wrong if the vector is in local/object space.
Signature
static UE_INL_API FVector Multiply_VectorVector(FVector A, FVector B); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | FVector | The first vector. | — |
| B | FVector | The second vector. | — |
Return Type
FVector Example
Project velocity onto the XY plane by zeroing Z C++
FVector Velocity = MyCharacter->GetVelocity();
FVector HorizontalOnly = UKismetMathLibrary::Multiply_VectorVector(Velocity, FVector(1.f, 1.f, 0.f)); See Also
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?