RealDocs

UKismetMathLibrary::Add_Vector4Vector4

function Engine Blueprint Since 4.0
#include "Kismet/KismetMathLibrary.h"
Access: public Specifiers: staticUFUNCTIONBlueprintPure

Description

Returns the component-wise sum of two FVector4 values (A + B). All four components (X, Y, Z, W) are added independently.

Caveats & Gotchas

  • W is added just like X, Y, Z. If your vectors represent homogeneous coordinates (W=1 for points, W=0 for directions), the result's W will be 2 for point+point — which is typically not what you want. Use FVector addition instead for positional math.
  • There is no scalar overload exposed to Blueprint for Vector4; to add a uniform offset you must construct a Vector4 first.

Signature

static UE_INL_API FVector4 Add_Vector4Vector4(const FVector4& A, const FVector4& B)

Parameters

Name Type Description Default
A const FVector4& First vector.
B const FVector4& Second vector.

Return Type

FVector4

Example

Accumulate two Vector4 offsets C++
FVector4 A(1.0, 2.0, 3.0, 0.0);
FVector4 B(4.0, 5.0, 6.0, 0.0);
FVector4 Result = UKismetMathLibrary::Add_Vector4Vector4(A, B);
// Result == (5, 7, 9, 0)

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.