CameraShake multiplayer replication problem

Hello !
I have a problem, I’m learning UE5 online system. And unfortunatly i’m stuck with a problem that I don’t see anybody talk about.
So my problem is that i’m playing a camera shake when players are walking, shooting or running, but these shakes applies on all player when the server is doing these actions. So if a client is shooting or running, only him will get the shakes, but if the server player do it, everybody will have this shake.

So don’t know how to make this thing works, am I forgetting something? am I misunderstanding something about how multiplayer works ? (it might be the case)

Also i’m on a listen server (i don’t really know what does it means but in case of )

Thanks in advance, have a great day

Shakes should only apply to the Autonomous Proxy. You need to apply flow logic that excludes all others from the shake.

  • Get Role
  • Get Network Role
  • Switch has Authority
  • etc

Any “combination” of the above will do.

1 Like

Separating server actions and limiting them to certain players is tricky for sure. I find an easy way to separate actors from others in replication such as this is identifying the player in question and talking directly to that player’s player state.

If you can get the player’s player controller from a reference from any particular action, you can cast to that player controller, retrieve the player state reference from that player controller and then cast to that specific player state and execute logic locally from a server call like widgets and camera shakes without them affecting everyone as a whole.

If you have a server event calling for camera shake its gonna shake everyone, but if you call it’s player state from its player controller you can do things specifically on the player in question.

In your case you could probably keep the custom event inside your character blueprint and call it from the player state which in turn is called from the server event.

Your server event should have a player controller variable passed through the event itself into a cast to the player controller to retrieve the player state and from the player state call the event in the character blueprint like in your example.

thanks you all! I have now a better understanding! Thanks you all ! Have a great day !