RealDocs

AActor::K2_SetActorRotation

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

Description

Sets the actor's world-space rotation instantly. This is the Blueprint-callable variant of SetActorRotation, surfaced as 'Set Actor Rotation' in Blueprint graphs.

Caveats & Gotchas

  • In C++, prefer SetActorRotation(FRotator, ETeleportType) — the bool variant here is the Blueprint-friendly wrapper and the ETeleportType overload is more expressive in native code.
  • Simulated physics children attached to this actor do not update their rotation when bTeleportPhysics is false; only the non-simulated attachment hierarchy moves correctly.

Signature

ENGINE_API bool K2_SetActorRotation(FRotator NewRotation, bool bTeleportPhysics)

Parameters

Name Type Description Default
NewRotation FRotator The new world-space rotation for the actor.
bTeleportPhysics bool If true, preserves physics angular velocity (teleport). If false, updates angular velocity from the rotation delta.

Return Type

bool

Examples

Rotate this actor to face a fixed direction on BeginPlay Blueprint
Event BeginPlay Set Actor Rotation Target is Actor Target New Rotation Teleport Physics false false Return Value Make Rotator Pitch 0.0 Yaw 45.0 Roll 0.0 Return Value Return Value
Edit Blueprint graph Rotate this actor to face a fixed direction on BeginPlay
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 to face a target C++
FVector Direction = (TargetLocation - GetActorLocation()).GetSafeNormal();
FRotator NewRot = Direction.Rotation();
K2_SetActorRotation(NewRot, 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.