AActor::K2_SetActorRotation
#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
Rotate actor to face a target C++
FVector Direction = (TargetLocation - GetActorLocation()).GetSafeNormal();
FRotator NewRot = Direction.Rotation();
K2_SetActorRotation(NewRot, false); See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?