ACharacter::CanUseRootMotionRepMove
#include "GameFramework/Character.h"
Access: public
Specifiers: ENGINE_API
Description
Determines whether a buffered server root motion move is compatible with the current client montage state and can be used to teleport the client back to that position for correction.
Caveats & Gotchas
- • Compatibility is determined by comparing the montage asset, section, and position stored in the buffered move against the current client state. A mismatch in any of these returns false, meaning no correction is applied.
- • This is a const query called in a tight loop by FindRootMotionRepMove. It should not perform expensive operations if overridden.
Signature
ENGINE_API bool CanUseRootMotionRepMove(const FSimulatedRootMotionReplicatedMove& RootMotionRepMove, const FAnimMontageInstance& ClientMontageInstance) const; Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| RootMotionRepMove | const FSimulatedRootMotionReplicatedMove& | A buffered replicated root motion move from the server. | — |
| ClientMontageInstance | const FAnimMontageInstance& | The currently active montage instance on the client to compare against. | — |
Return Type
bool Example
Manual compatibility check before restoring a move C++
for (int32 i = Character->RootMotionRepMoves.Num() - 1; i >= 0; --i)
{
if (Character->CanUseRootMotionRepMove(Character->RootMotionRepMoves[i], *MontageInstance))
{
Character->RestoreReplicatedMove(Character->RootMotionRepMoves[i]);
break;
}
} See Also
Version History
Introduced in: 4.14
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?