Animation Replicating through BP but not C++ RPCs

Hello,

I am trying to replicate animations, so everyone can see them. In blueprints I tested it like this:

It works and replicates across clients and the server, but I transfer is to c++ and it doesnt work.
In C++ I am doing it like this:

void AValorCharacter::Server_PlayAnimation_Implementation(UAnimMontage * Animation, float playrate, FName Section, AValorCharacter * Character)
{
	Multicast_PlayAnimation(Animation, playrate, Section, Character);
}
bool AValorCharacter::Server_PlayAnimation_Validate(UAnimMontage * Animation, float playrate, FName Section, AValorCharacter * Character)
{
	return true;
}

void AValorCharacter::Multicast_PlayAnimation_Implementation(UAnimMontage *Animation, float playrate, FName Section, AValorCharacter* Character)
{
	PlayAnimMontage(Animation, playrate, Section);
}
	
bool AValorCharacter::Multicast_PlayAnimation_Validate(UAnimMontage *Animation, float playrate, FName Section, AValorCharacter* Character)
{
	return true;
}

Whats happening is that the root motion of the animation is moving the character around but none of the bones move or animate. What’s going on?

Hey @ZeroParadigm , The server can play the animation, but it does not show on any clients. When the client plays the animation it does not show on any clients or the server. But the root motion is still being replicated, just not the animation.

Hi @zykren , is the animation playing on any clients? (Owning client, remote clients) Your description sounds like the animation is being played somewhere since the root motion is occurring.

As a check, can you successfully play the animation on your owning client without involving the server call?

Fixed, I had a wrong specifier in the UFUNCTION tag in the c++ code

Hmm…are you using a listen server? Also, just to make sure, are you testing in PIE or are you actually launching multiple instances of the game uncooked game?

Nice job!

Is it root motion ? If yes root motion does not work much still in Multiplayer right ? Very often server disagree with client track position and it’s correcting client position which is very noticeable.