Why is the Client branching montage not running on the server?

I’m trying to migrate [Network Tutorial][1] with [BP-TPP Tutorial][2].
It works well except about “Punching” animation.
It is also fine for the server to do Punching to clients (Server->Clients),
making “IsPunching?” rep-notify in Character-BP.

But the problem is that, when client TPP character do punching, its animation don’t play on the server.
(Clients → Server)

For client requests server, I thought I should use RPC. But simply making Punch-Event in Animation-BP
“run-on-the-server” didn’t affect anything, while RPC on Character-BP do a little.

In the graph, Montage:StartPunch runs on the server but, repeat section(Punch1>Punch2) don’t occur.
And I didn’t find means to access the branching montage point (IsStillPunching1/2) on Character-BP.
I also think there may be much better way for server animation to run on clients
without simply making IsPunching1 replicated.

All samples of Marketplace doesn’t show a example about “Montage over Network” things.
Similar problems are found on [forum][4] and [here][5]. However, the former isn’t about Animation
and the latter don’t say the reason ( The poster also says he’s not sure about the reason there).

Sorry I’m not good at English. Thanks for reading very much.

I missed a difference between “Play Anim Montage” and “Montage Play”.
Being context checked, I don’t see Montage Play, and replacing PlayAnimMontage it.
I had to retrieve AnimInstance from mesh component
because MontagePlay requires it which PlayAnimMontage doesn’t.
And I had to also check authority just after click/release.
I don’t know why without authority doesn’t it run but this is how I managed to make it run to loop punching.

However, branching montage point doesn’t seem run on server.
This was because AnimBP IsPunching? flag was not replicated for server to broadcast to clients.

I think you are close! An RPC is the only way to communicate client->server. Only the MyCharacter blueprint can have replicated properties/events (the AnimationBlueprint itself cannot). The setup I see in your last picture looks like it should be setting the IsPunching1 bool properly on the server when the client presses and then releases his input button.

My guess is one of the following is happening:

  • Something else is setting IsPunching1 elsewhere; e.g, it is getting overridden.
  • You are not properly passing the IsPunching1 variable from the MyCharacter blueprint into the animation blueprint. I think in the TPP tutorial this is done in the AnimationBlueprint update event. Make sure that is set up properly.

If those two things check out, I think the best thing to do is start debugging step by step. You should be able to do “Displayall MyCharacter_C IsPunching1” at the console to inspect the value of IsPunching1 at any given time (note this is a little hard to decipher since if you do multiplayer PIE both worlds will show up on the screen and each world has two MyCharacters in a two client game. Look at the full path to determine what world each MyCharacter instance belongs to).

You could also add print statements before and after setting IsPunching1. Print out the value before setting. This will confirm if something else is overriding the value and/or if the server is actually getting the RPCs like you would expect.