UKismetMathLibrary::Matrix_GetColumn
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Returns the specified column of the matrix as an FVector (ignoring the 4th/W row element). Column W returns the translation vector of the transform.
Caveats & Gotchas
- • FMatrix in UE is stored row-major internally, so accessing a column requires reading one element from each row — this is not a simple memory copy. In tight loops, prefer caching the result.
- • The returned FVector captures only XYZ of the column — the 4th element (row 3, column N) is dropped. For column W specifically, this discards M[3][3] which is 1.0f in standard transform matrices and is safe to ignore in practice.
Signature
static UE_INL_API FVector Matrix_GetColumn(const FMatrix& M, TEnumAsByte<EMatrixColumns::Type> Column) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| M | const FMatrix& | The matrix to read from. | — |
| Column | TEnumAsByte<EMatrixColumns::Type> | Which column to return: EMatrixColumns::X (0), Y (1), Z (2), or W (3). | — |
Return Type
FVector Example
Extract the translation column (W) from a matrix C++
FMatrix M = MyActor->GetTransform().ToMatrixWithScale();
FVector Translation = UKismetMathLibrary::Matrix_GetColumn(M, EMatrixColumns::W);
// Translation == MyActor's world position Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?