RealDocs

AActor::K2_AddActorLocalRotation

function Engine Blueprint Since 4.0
#include "GameFramework/Actor.h"
Access: public Specifiers: UFUNCTIONBlueprintCallable

Description

Adds a delta rotation in the actor's local reference frame. Rotating around the local Z axis always spins the actor around its own up vector, regardless of its world orientation.

Caveats & Gotchas

  • bSweep has no effect for rotation — blocking hits during rotation are not detected. Do not check SweepHitResult after this call.
  • FRotator addition in local space can suffer gimbal lock. In C++, prefer AddActorLocalRotation with the FQuat overload for numerically stable rotations.

Signature

ENGINE_API void K2_AddActorLocalRotation(FRotator DeltaRotation, bool bSweep, FHitResult& SweepHitResult, bool bTeleport);

Parameters

Name Type Description Default
DeltaRotation FRotator The change in rotation in the actor's local reference frame.
bSweep bool Whether to sweep (not currently supported for rotation — has no effect).
SweepHitResult FHitResult& Output hit result; will not be populated since sweep is unsupported for rotation.
bTeleport bool If true, physics velocity is preserved. If false, velocity is updated based on angular displacement.

Return Type

void

Examples

Spin the actor 5 degrees around its local up axis each tick Blueprint
Event Tick Delta Seconds Delta Seconds Add Actor Local Rotation Target is Actor Delta Rotation Sweep false Teleport false Make Rotator Pitch 0.0 Yaw 5.0 Roll 0.0 Return Value Return Value
Edit Blueprint graph Spin the actor 5 degrees around its local up axis each tick
Drag node headers to move · Drag from an output pin to an input pin to connect · Scroll to zoom · Right-click for actions
Rotate actor around its own up axis each tick C++
void AMyActor::Tick(float DeltaTime)
{
    Super::Tick(DeltaTime);
    FHitResult Hit;
    K2_AddActorLocalRotation(FRotator(0.f, 90.f * DeltaTime, 0.f), false, Hit, false);
}

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.