Fix Remote Event Delay

I’m currently using a remote event to send some stuff from the client to the server but there seems to be a delay in it. I can’t move the server code to the client as i need it on the server and I can’t move the client code to the server so I’m not sure how to fix this. Does anyone know any other solutions?

1 Like

Could you provide your code used for the remote?

1 Like

Also I would recommend using RemoteFunction instead of RemoteEvent to request data from the server to minimize delay, and optimize the server-side code to handle requests efficiently for better responsiveness.

1 Like

As with all things contacting the server, there will be latency. Latency in the server isn’t really something you can fix unless you have a good connection. However with Roblox studio, it will simulate that latency.

latency is essentially the time it takes for the client to talk to the server and back, which the optimal amount should be less than 500ms (ms meaning milliseconds). Plus the server has to then replicate whatever is being sent across the client

But it also depends on what it’s doing, if you are using it visual/detail purposes, consider using a UnreliableRemoteEvent for that purpose, which would be faster.

Edit: Remote events can slow down if you constantly firing them as well, so be careful with that.

3 Likes

Like @DasKairo said there’s bound to be latency and you basically can’t do anything. BUT, if you like REALLLLY want it to be the fastest you can make it, LIKE REAAAAAALLY. i don’t recommend doing this but if you REAAAAAAAALLY want to do it then REAAAAAAAALLY use the task library so like task.spawn() for example or coroutine library things. BECAUSE REAAAA- Edit: I also don’t know your code so it could be a bad idea.

1 Like

Indeed, latency is inherent in server-client communication, but using RemoteFunction can help mitigate this by allowing synchronous requests and responses, reducing wait times for critical operations. I consider leveraging RemoteFunction for tasks requiring immediate feedback or precise timing to optimize performance.

1 Like

how exactly does task.spawn() work? I can’t find much online about it.
Also from what I have found online how would that help with my problem because it doesn’t fix my client server problem?

1 Like

Well, you can’t really fix it. Your delay is more of a backend problem (unless you show your code). The only “fix” you could try to do is use task library functions like task.spawn or coroutine library functions like coroutine.wrap, or you could even combine them together. Task.spawn() basically just resumes a function immediately (in short words does it as fast as it can). It’s kinda hard to explain… (You could also use task.defer which doesn’t cause performance issues that task.spawn or coroutine.wrap does, they both resume the function immediately)

1 Like