ACharacter::GetRepRootMotion
#include "GameFramework/Character.h"
Access: public
Specifiers: inlineconst
Description
Returns a const reference to the replicated root-motion montage struct. Use this to inspect the current networked root-motion state without allowing modification.
Caveats & Gotchas
- • Returns a reference to the internal struct; do not store the reference past the call site as it can be invalidated by replication updates.
- • On the server this reflects the authoritative state being prepared for replication; on clients it reflects the last replicated value, which may be one tick stale.
Signature
inline const FRepRootMotionMontage& GetRepRootMotion() const { return RepRootMotion; } Return Type
const FRepRootMotionMontage& Example
Check if replicated root motion is active C++
const FRepRootMotionMontage& RMRep = GetRepRootMotion();
if (RMRep.bIsActive)
{
UE_LOG(LogTemp, Log, TEXT("Root motion montage is active at position %f"), RMRep.Position);
} Version History
Introduced in: 4.6
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?