RealDocs

UKismetMathLibrary::RotateAngleAxis

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

Description

Rotates a vector by a given angle around a specified axis using the right-hand rule. Useful for orbiting objects, spinning projectiles, or computing rotated offsets without constructing a full FQuat.

Caveats & Gotchas

  • The Axis vector should be normalised before passing in. Passing a non-unit axis will scale the result incorrectly — the rotation distance depends on the axis magnitude.
  • AngleDeg uses degrees, not radians. A common mistake is passing a radian value and getting unexpected large rotations.
  • This is equivalent to FVector::RotateAngleAxis on an FVector instance. In Blueprint it appears as 'Rotate Vector Around Axis'.

Signature

static ENGINE_API FVector RotateAngleAxis(FVector InVect, float AngleDeg, FVector Axis);

Parameters

Name Type Description Default
InVect FVector The vector to rotate.
AngleDeg float Angle in degrees to rotate by.
Axis FVector The axis to rotate around. Should be normalised.

Return Type

FVector

Example

Orbit a point around an actor's up axis C++
FVector Offset(100.f, 0.f, 0.f);
FVector UpAxis = GetActorUpVector();
FVector RotatedOffset = UKismetMathLibrary::RotateAngleAxis(Offset, 45.f, UpAxis);
FVector NewLocation = GetActorLocation() + RotatedOffset;

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.