RealDocs

ACharacter::OnRep_RootMotion

function Engine Since 4.14
#include "GameFramework/Character.h"
Access: public Specifiers: ENGINE_APIUFUNCTION

Description

RepNotify called on simulated proxies when the RepRootMotion property is replicated from the server. Handles applying the replicated montage root motion state and correcting position on non-owning clients.

Caveats & Gotchas

  • This fires only on simulated proxies — it does not fire on the server or the owning autonomous proxy. If you need to respond to root motion changes on the autonomous proxy, listen to the movement component's events instead.
  • Overriding this without calling Super::OnRep_RootMotion() will break root motion replication entirely for simulated proxies, causing them to freeze or desync mid-montage.

Signature

ENGINE_API void OnRep_RootMotion();

Return Type

void

Example

Override to trigger VFX on simulated proxy root motion apply C++
void AMyCharacter::OnRep_RootMotion()
{
	Super::OnRep_RootMotion();
	// Spawn impact VFX on simulated clients when root motion corrects position
	if (RepRootMotion.bIsActive)
	{
		SpawnRootMotionVFX(GetActorLocation());
	}
}

Version History

Introduced in: 4.14

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.