Is This Bad Form? Character Movement Replication.

Character movement speed is reduced during a punch animation. Here is the workflow leading up to what I am questioning is proper replication.

Character BP

Button Pressed → Server Event → Multicast Event → Play Montage “Punch” →

This seems to work fine, but it feels wrong. I am multicasting the montage and then running a server event to replicate the changing movement speed, and simultaneously changing it client-side after checking if the player controller = the actor’s owner.

I multicast printed the character max walk speed and the clients are all printing appropriately, as well as the server on behalf of the client affected (if I am interpreting correctly)

222

Is this OK? I am also confused as to when/why variables need to be set to replicate when I have to manually set them server side anyway.

“Run On Server” RPC you use to call a server function from an owning client.
Replicated variables you use for lasting state changes.
Multicast RPC’s you use for effects that only matter in that exact moment.

It is probably okay and the best you can do in Blueprint however the proper way of doing it would be using C++ and implement client prediction on the Movement Component as well.

Would you further elaborate on that? If each player has a unique float variable titled “max stamina” and this float can change as the match progresses, does it need to be set to replicate if whenever it is changed I use a “Run On Server” RPC? Isn’t that replicating it?