UCharacterMovementComponent::UpdateBasedRotation
#include "GameFramework/CharacterMovementComponent.h"
Access: public
Specifiers: virtual
Description
Applies the movement base's rotation delta to the controller's view rotation so a character standing on a rotating platform turns with it.
Caveats & Gotchas
- • Only affects the Controller's ControlRotation, not the character mesh/capsule rotation directly — capsule rotation on a rotating base is handled separately in the based-movement update.
- • Does nothing if the character has no Controller (e.g. a ragdoll or a pawn with no possessing controller).
- • Called from UpdateBasedMovement(); overriding it without calling Super can silently break camera-follow behaviour on rotating platforms.
Signature
virtual void UpdateBasedRotation(FRotator& FinalRotation, const FRotator& ReducedRotation); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| FinalRotation | FRotator& | The controller's rotation before the base's rotation delta is applied; modified in place to include the base's rotation. | — |
| ReducedRotation | const FRotator& | The portion of the base's rotation delta that should actually be applied (may be reduced per-axis by movement base settings). | — |
Return Type
void Example
Clamping how much base rotation affects the camera C++
void UMyCharacterMovementComponent::UpdateBasedRotation(FRotator& FinalRotation, const FRotator& ReducedRotation)
{
FRotator Clamped = ReducedRotation;
Clamped.Pitch = 0.f;
Clamped.Roll = 0.f;
Super::UpdateBasedRotation(FinalRotation, Clamped);
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?