RealDocs

UKismetMathLibrary::GetUpVector

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

Description

Returns the world-space unit vector pointing in the up (Z+) direction for the given rotation. Equivalent to rotating FVector::UpVector by InRot.

Caveats & Gotchas

  • For a character standing upright with no roll, this returns approximately (0,0,1). Adding roll rotates this vector, so for terrain-following normals you should query the surface normal directly rather than relying on the character's up vector.
  • This is the up of the rotation's local frame, not the world up — useful for tilted surfaces and vehicles, but can mislead if you only expected a world-up check.

Signature

static ENGINE_API FVector GetUpVector(FRotator InRot);

Parameters

Name Type Description Default
InRot FRotator The rotation to convert.

Return Type

FVector

Example

Orient a decal to a rotated surface C++
FVector SurfaceUp = UKismetMathLibrary::GetUpVector(SurfaceRotation);
DecalComponent->SetWorldRotation(SurfaceUp.ToOrientationRotator());

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.