UKismetMathLibrary::MakeVector4
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Constructs an FVector4 from four double-precision components. Marked NativeMakeFunc so Blueprint's Make Vector4 node maps to this function automatically.
Caveats & Gotchas
- • All parameters are double in UE5 (FVector4 uses double precision). Passing float literals is fine but they silently promote — use explicit double literals (e.g. 1.0 not 1.f) to avoid implicit conversions in precision-sensitive code.
- • W has no default value in C++ — all four components must be supplied. The Blueprint node pins default to 0 visually, but in C++ omitting W is a compile error.
Signature
static UE_INL_API FVector4 MakeVector4(double X, double Y, double Z, double W); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| X | double | X component. | — |
| Y | double | Y component. | — |
| Z | double | Z component. | — |
| W | double | W component. | — |
Return Type
FVector4 Example
Create a homogeneous coordinate vector C++
// W=1 = point, W=0 = direction in homogeneous coordinates
FVector4 Point = UKismetMathLibrary::MakeVector4(100.0, 200.0, 50.0, 1.0);
FVector4 Dir = UKismetMathLibrary::MakeVector4(1.0, 0.0, 0.0, 0.0); See Also
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?