Server Lag Problems

I am using raycastV4 to make my hitboxes and i get this weird delay in server

robloxapp-20220728-1958086.wmv (4.7 MB)

1 Like

This is because of client latency.

RaycastHitboxV4 calculates the hitbox on the server, and because of this, the accuracy of your hits will be directly related to how good your ping is.

In this case, you can use ClientCast as an alternative. It utilizes raycasting the same way that RaycastHitboxV4 does, and (unlike RaycastHitboxV4) lets you calculate the hitbox to the client. Which leads to a responsive and non-laggy combat experience.

Of course, this makes it slightly more vulnerable to exploits. To prevent exploiters from “reach-hacking”, you can implement your own sanity check. ClientCast does not do this for you automatically, but it does have an example on how you would do something like this.


I will actualy try this, ill mark yours as the solution if it works, thank you!