My current project contains melee combat, which means there is a lot of things happening on the client side, and server side. This is my first game using FilterEnabled, and I wasn't sure what the best method of dealing with lag would be; so I simply made the scripts in charge of swords and sword combat server side. This works great, except for the input lag. When someone clicks to swing their sword, the server script loads the animation (swinging sword) into the humanoid and checks for Touches while it's swinging. Depending on the number of players, there is a noticeable space of time between clicking and the animation loading.
My first thought was to load the animation with a LocalScript because animations replicate. This made input response immediate, but since it moved the delay to you seeing the animation instantly vs other clients seeing it later. Being struck with swords no longer looked accurate on everyone else's screen. The biggest obstacle is that I'm using directional combat, which means you choose a direction to swing, and your opponent sees this animation start and has to block in that direction before the sword hits them.
I'm not sure where I go from here. People don't like input lag, and people don't like being hit by a sword that they were out of range of on their screen. Anyone have any ideas on how to deal with this?

1 comment
Thanks for the idea, I will look into it and let you know how it goes.