RealDocs

AActor::K2_SetActorRelativeRotation

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

Description

Sets the actor's RootComponent to the given rotation relative to its parent actor. If the actor has no parent, this sets the world rotation.

Caveats & Gotchas

  • bSweep has no effect for rotation — blocking hits during rotation are not detected. Do not check SweepHitResult.
  • In C++ prefer SetActorRelativeRotation, which also accepts an FQuat overload for gimbal-lock-free rotation and uses ETeleportType instead of a bool.

Signature

ENGINE_API void K2_SetActorRelativeRotation(FRotator NewRelativeRotation, bool bSweep, FHitResult& SweepHitResult, bool bTeleport);

Parameters

Name Type Description Default
NewRelativeRotation FRotator The new rotation relative to the actor's parent (or world rotation if unattached).
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 the angular displacement.

Return Type

void

Examples

Face this actor 90 degrees from its parent on BeginPlay Blueprint
Event BeginPlay Set Actor Relative Rotation Target is Actor Target New Relative Rotation New Relative Rotation Sweep false Teleport false Sweep Hit Result Make Rotator Pitch 0.0 Yaw 90.0 Roll 0.0 Return Value Return Value
Edit Blueprint graph Face this actor 90 degrees from its parent 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
Set the relative yaw of an attached child actor C++
FHitResult Hit;
// Face the child 90 degrees from the parent's forward
ChildActor->K2_SetActorRelativeRotation(FRotator(0.f, 90.f, 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.