Hey, I’ll have a video of what I mean below. I know it’s because of a client to server issue but I wanna know if there are any possible fixes.
Basically I’m making a sword for my game, however when I fire a remote event to the server for the raycast it’s where the Character is on the server instead of the client meaning there’s delay, is there any fix to this?
Another issue is that there’s a delay with remote events, I thought of using a tool instead but it still causes the main issue.
Red is the servers raycast and Blue is the clients raycast
You could send your local character’s position to the server when you make an attack, then use that for the raycast instead. I’d put a distance check in there to make sure the player isn’t cheating though.
Also the opposite can occur where an enemy is no longer in the same position as they were on the client when the client reports an attack to the server. You can somewhat fix this by making a list of positions the enemy was at then “rewinding” their hitbox based on the attacker’s ping.