How to constantly fire a remote event without getting event exhaust errors?

  1. What do you want to achieve? Keep it simple and clear!

I want to repeatedly fire a remote event that sends the players mouse position to the server so that a part can follow to where the players mouse is.

  1. What is the issue? Include screenshots / videos if possible!

I am getting event exhaust errors.

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I tried using UserInputService.InputChanged to check if the mouse moved and added a delay to the remote event. The delay helped a bit, but it still sent an event exhaust call after a while. I also would prefer if I didn’t use a delay as I want the movement to be smooth.

I am using RunService.Stepped, if that helps.

Just keep it on the client??, Then when the player clicks you can send it to the server.

  1. Im pretty sure it won’t look as nice because you cant update the server every 0.1 seconds with a remote event. ( There is some delay)

  2. You’ll still be able to see where you’re mouse is moving if you keep it on the client.

I don’t think you understand. I want:

a part can follow to where the mouse is.

I want it so that it will be following where your mouse is.
It doesn’t have to move incredibly smooth, but I don’t want it to update at one frame per second.

Then handle it on the client?, Do you want it as when the player clicks it creates a part where the mouse is?

Then handle it on the client?

I want it so other players can see the part moving. I simplified what I said that I wanted to achieve, the part moving on the server is important to what I am doing.

Do you want it as when the player clicks it creates a part where the mouse is?

I’m not checking when the player clicks, I’m checking when and where the player moves their mouse.
The part is already created. It moves along with your mouse; follows your mouse.

You don’t need to fire the remote event as frequently as you are now for other players, as long as you just animate between the points of the movement using lerping or TweenService or whatever other method.

I’d recommend making it a lot smoother on the client side by making it update every frame, and firing the remote less frequently as to not exhaust it or cause unnecessary lag for other players.
Use RenderStepped (or one of the new RunService functions) to update it on the client, and every 0.1 or 0.2 or whatever amount of seconds to fire the event to update it.

Other players will not notice a difference of 0.1 seconds or even a higher delay if it’s animated on their own client to be smooth too.

3 Likes