ACharacter::RestoreReplicatedMove
#include "GameFramework/Character.h"
Access: public
Specifiers: ENGINE_API
Description
Applies a previously buffered server root motion move to the character, teleporting it back to the replicated position and restarting the montage from the saved state. Returns true if the restore was successful.
Caveats & Gotchas
- • This performs an immediate teleport of the character to the buffered position. Calling this at the wrong time or with a stale move can cause a visible snap or put the character inside geometry.
- • Should only be called after CanUseRootMotionRepMove() returns true for the given move. Calling it with an incompatible move leads to animation and position desync.
Signature
ENGINE_API bool RestoreReplicatedMove(const FSimulatedRootMotionReplicatedMove& RootMotionRepMove); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| RootMotionRepMove | const FSimulatedRootMotionReplicatedMove& | The buffered server root motion move to restore from. | — |
Return Type
bool Example
Restore root motion state from a buffered move C++
const int32 Idx = Character->FindRootMotionRepMove(*MontageInstance);
if (Idx != INDEX_NONE)
{
const bool bRestored = Character->RestoreReplicatedMove(Character->RootMotionRepMoves[Idx]);
if (!bRestored)
{
UE_LOG(LogTemp, Warning, TEXT("RestoreReplicatedMove failed"));
}
} See Also
Version History
Introduced in: 4.14
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?