UKismetMathLibrary::Conv_VectorToVector2D
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticBlueprintPure
Description
Extracts the X and Y components of a 3D vector into an FVector2D, discarding the Z component entirely.
Caveats & Gotchas
- • The Z component is silently dropped with no warning. If Z carries important data (e.g. height), the conversion will silently discard it.
- • The result uses X and Y, not X and Z. For top-down XZ plane logic (common in minimap or overhead projection), construct FVector2D(Vec.X, Vec.Z) manually.
Signature
static ENGINE_API FVector2D Conv_VectorToVector2D(FVector InVector); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| InVector | FVector | The 3D vector to truncate to 2D. | — |
Return Type
FVector2D Example
Project a world position onto a 2D UI map C++
FVector WorldPos = Actor->GetActorLocation();
// X and Y world coords map to 2D; Z (height) is discarded
FVector2D MapPos = UKismetMathLibrary::Conv_VectorToVector2D(WorldPos); Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?