Hey so I have made a combat system and when a player is hit, they are supposed to be stunned, however, after I get the player’s hit (client-side) I need to send the list of characters to the server to check if these player’s are blocking or not… After the server confirms they aren’t blocking, I use a Remote Event to send the information to the hit player’s client and stun them locally.
(my stun includes a walk speed reduction, jump height reduction, and an animation)
Unfortunately I’ve noticed there is a noticeable delay from when a player is hit to when they are actually stunned. (this delay is only there for the player that is hitting) I don’t know how to reduce this as I NEED to check if they are blocking/parrying and those values are located server side, also, I don’t think that’s the reason for the delay because when a player is stunned, it looks instant on their client, the delay only shows for the other player (who is hitting).
I’ve done some research online and on here, however, most people seem to just say “ah nothin you can do about it” so I’m looking for different solutions (I hope).
I may be ignorant, but I don’t think my exact code is needed in this post as I don’t think it has to do with my current scripts (I made sure I have no manual delays like “task.wait” or “task.delay”)
But, if any code is needed to help me out please let me know!
TLDR; In my combat system, I check if a player who’s been hit is blocking on the server, if they aren’t I stun them on the client…There is a significant delay between when I confirm they aren’t blocking (server-side) and when they are stunned (client-side) but the delay isn’t visible for the player who is actually getting stunned.
(I’m using remote events)
Here’s a video demonstrating the delay: (delayed)
https://i.gyazo.com/5973a1923da815b7b4ae2ea7f14c4e44.mp4
What it looks like from the client’s perspective (no delay)
https://i.gyazo.com/5e68afa3f4a25385d14ac7368a589ee8.mp4