Hi! I am currently trying to make a hitbox system which currently works great but from what I’ve read, it’s not very reliable if the client has high ping or experiences lag(spikes).
I have tried using invokeclient() from a server script in order to get humanoidrootpart cframe and position it, to get player-friendly combat experience.
From what I’ve read, if the player runs into ping/lag issues then the client will respond with a delay, which will give the laggy person an advantage to other players by delaying their hitbox timing with their animation timing.
I have also tried getting humanoidrootpart cframe info from server script alone. From what I have noticed, it tends to delay the hitbox position from the client’s character position, which could ruin the player’s combat experience.
This method should be more reliable from the other method since whenever the player lags, it still shouldn’t delay the hitbox timing.
Now the actual reason for my post: Is there an InvokeClient alternative? I really wanna have my hitbox system be reliable in both it’s client positioning & timing no matter if the player has high ping or experiences lag spikes.
From what I know it’s pretty much impossible to do this, as in any way you will always be experiencing delay, not even info can be instantaneous (even though it moves at 1,079999e+12 meters per hour)
I don’t know anything about that, but maybe what @Alexeidubardpro could be a kind of solution, as it might work most of the time, but form what I know if you have lag slimes and those things it’s almost impossible to get were exactly the Player would be
But it would still have delay, as the Server is still getting the position of the Player, so it could work half
So I discussed this earliuer on a similar thread. Essentially the problem is not with just roblox but with all FPS shooters. If you invoke the client to return the cframe of the player you are waiting for the player to get the information and send it back which depending on ping can range greatly.
You could fire two instances of the raycast one on the server one on the client if the two do not both hit the target return false. That would be about as good as it could get. You could even see if the players mouse is hovering a target and request that targets client cframe and fire raycasy to and from to confirm further. You would get 3 solutions you could check to see if all 3 return true to get a successful hit.
Raycasts are not that bad on lag only but it is a performance tradeoff. And no Dede I wasnt saying kick the player lol. im telling you how games like call of duty handle these issues themselves.