Navigation
Unreal Engine C++ API Reference > Runtime > Engine > GameFramework > FRootMotionSource_ConstantForce
- FRootMotionSource::Matches()
- FRootMotionSource_ConstantForce::Matches()
References
Module | Engine |
Header | /Engine/Source/Runtime/Engine/Classes/GameFramework/RootMotionSource.h |
Include | #include "GameFramework/RootMotionSource.h" |
Source | /Engine/Source/Runtime/Engine/Private/GameFramework/RootMotionSource.cpp |
virtual bool Matches
&40;
const FRootMotionSource &42; Other
&41; const
Remarks
For well-networked RootMotionSources, any given FRootMotionSource child class could implement their own unique ID and simply use that in the Matches check. This "heuristic-style" default was chosen to simplify addition of new RootMotionSources, and assumes that in a networked setting a given RootMotionSource won't be applied many times in a given frame by the same instigator to the same target with the exact same parameters.
Guaranteed uniqueness would also require a strict application order ("RootMotionSources can only be added on Authority") or a prediction-based setup ("Apply on Autonomous and Simulated predictively, then apply on Authority and confirm, and if Authority doesn't confirm remove them"). We avoid that synchronization complexity for now.
See UCharacterMovementComponent::ConvertRootMotionServerIDsToLocalIDs
Should be overridden by child classes, as default implementation only contains basic equivalency checks Whether this is the same RootMotionSource as Other. This is used for networking when clients receive RootMotionSource data from the server and need to decide which local RootMotionSource to compare and apply the corrections to. This is required due to RootMotionSources in general being added independently on server and clients, not needing to know about each other by default.