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.
What is the issue? Include screenshots / videos if possible!
I am getting event exhaust errors.
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 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.
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.