Recoil Replication

For my multiplayer FPS I am trying to replicate recoil so that other players can tell when someone else is shooting. I have set up recoil with my ADS function but only for the first person viewpoint. For replicating the recoil I am using a montage of the fire animation in the anim starter pack. I’ve managed to get it so that the host can see when clients are firing, however clients cannot see the host or other clients when they fire. I don’t understand what the issue is as i have multicast and replicate to server for the montages and then the montage being called in the fire weapon input.



What are the values of isFiring/isAiming when the server runs MulticastSemiAim? Are you sure its the correct value at the point of running on the server/client?

Also, if it reaches the Play Montage node, what is the value of mesh on the client/server?

Apologies if something doesnt make sense as I am new to UE4 and programming in general. All the values are correct as the client can see the server play the montages as intended. However the server and clients can’t see the clients play the montages leading me to believe that it is a replication issue.

I’m not at my pc at the moment but I’ll try and replicate your setup and see where the issue might be when I have an opportunity to do so.

Hey @AusarMohatu ,

Replication isn’t my strong point, however, from what I can tell in my own tests, it seems that your isFiring/isAiming variables may not be replicating as you intended. If you add a print string in your MultiCastSemiAim and read the value of isFiring, is it true for server and client or only one?

Based on my understanding of replication you shouldn’t allow the client to make changes to the variables and changes should instead be “requested” on the server and fed back to the client via the replicated variable.

What happens if you handle setting isFiring/isAiming on the Server, does this fix your issue?

Some additional resources I found:

Thank you. The IsFiring variable wasn’t being set by the server.