AActor::K2_SetActorRelativeRotation
#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
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); See Also
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?