UKismetMathLibrary::Conv_Vector4ToVector
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Converts a Vector4 to a 3-component FVector by dropping the W element. Tagged BlueprintAutocast so Blueprint automatically inserts a conversion node when you wire a Vector4 pin to a Vector pin.
Caveats & Gotchas
- • W is silently discarded. If W carries meaningful data — homogeneous coordinate divide, alpha, or clip-space depth — handle that before calling this function.
- • No normalization is applied; the result length equals the XYZ magnitude of the input Vector4, which may not be 1 even if the input appeared to be a unit direction.
Signature
static UE_INL_API FVector Conv_Vector4ToVector(const FVector4& InVector4); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| InVector4 | FVector4 | The source Vector4. | — |
Return Type
FVector Example
Extract the XYZ world position from a homogeneous Vector4 C++
FVector4 HomogPos(400.0, 300.0, 100.0, 1.0); // W=1: no perspective divide needed
FVector WorldPos = UKismetMathLibrary::Conv_Vector4ToVector(HomogPos);
SetActorLocation(WorldPos); See Also
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?