UCharacterMovementComponent::MaybeUpdateBasedMovement
#include "GameFramework/CharacterMovementComponent.h"
Access: public
Specifiers: virtual
Description
Updates the character's position to follow its movement base immediately, or defers the update to after physics if the base is simulating physics.
Caveats & Gotchas
- • If the current movement base is a simulated-physics component, this sets bDeferUpdateBasedMovement and enables PostPhysicsTickFunction instead of updating immediately, so the character follows the base's final post-physics transform rather than a stale pre-physics one.
- • Always clears bDeferUpdateBasedMovement to false at the start, so calling it repeatedly in the same frame won't accumulate deferred state — only the outcome of this call's own base check matters.
- • Relies on CharacterOwner being valid with no HasValidData() guard, so calling it before the component has a CharacterOwner set will crash.
Signature
virtual void MaybeUpdateBasedMovement(float DeltaSeconds) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| DeltaSeconds | float | Time step to apply to the based-movement update. | — |
Return Type
void Example
Updating based movement each tick C++
void UMyCharacterMovementComponent::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
MaybeUpdateBasedMovement(DeltaTime);
} See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?