Basically, whenever I hit another player I made it so the client would play a hit animation and do effects,however, there’s a pretty annoying delay between the hit and the effects
I have no idea what’s causing the delay but this is the current method I play the effects:
client calls the server to verify the hit and do damage
server plays the animations and fires all clients to play the effects
The client should usually determine if it hit and play the animations, while the server validates the hit after the visualization on the client and if it’s validated do damage and replicate it to other clients
There’s usually not a reason to make it in sync with what everyone else sees, all you can usually do it make it in sync for the client within itself and then make it in sync separately for the other clients
client plays anims and determines whether or not they hit, and if they do, have them create vfx on their end and tell the server to verify the hit and do damage
server verifies the hit by using a magnitude check based on the clients current position and the targets current position, and replicates the VFX to all clients except the client that fired the remote