FRootMotionSource_MoveToForce::Matches

For well-networked RootMotionSources, any given [FRootMotionSource](API\Runtime\Engine\GameFramework\FRootMotionSource) child class could implement their own unique ID and simply use that in the Matches check.

Windows
MacOS
Linux

Override Hierarchy

FRootMotionSource::Matches()

FRootMotionSource_MoveToForce::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

Syntax

virtual bool Matches
(
    const FRootMotionSource * Other
) 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

Returns

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.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss