RealDocs

UKismetMathLibrary::Quat_GetAxisZ

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

Description

Returns the up direction (local Z axis) of the coordinate frame represented by this quaternion. Equivalent to rotating FVector::UpVector (0,0,1) by Q.

Caveats & Gotchas

  • For characters with default UE orientation, this points upward along the capsule. After applying arbitrary rotations (e.g. procedural animation), the result may no longer align with world up — use with care when computing gravity-relative logic.
  • Functionally identical to Quat_VectorUp; both exist as aliases. Prefer whichever is clearer in context.

Signature

static UE_INL_API FVector Quat_GetAxisZ(const FQuat& Q);

Parameters

Name Type Description Default
Q const FQuat& The quaternion representing the orientation.

Return Type

FVector

Example

Align a decal normal with the object's up axis C++
FQuat MeshQuat = MeshComponent->GetComponentQuat();
FVector UpAxis = UKismetMathLibrary::Quat_GetAxisZ(MeshQuat);
DecalComponent->SetWorldRotation(UpAxis.Rotation());

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.