#Slow Triggers from Mouse.Move

1 messages · Page 1 of 1 (latest)

copper ridge
#

So, my problem is that im making a whiteboard project thing, however a big annoyance i've found is that for when i'd draw faster, gaps would appear due to the mouse.Move event just being too slow. I've added a video showcasing my problem along with the relevant scripts

#

How it works is that it detects mouse movement at the MouseDetect localscript and send a Bindable message to the server script every time the mouse.Move event triggers.

It will later be processed on the server script depending on the tool used
In this case the tools relevant are brush and pencil

Brush creates a circle at the spot the mouse is on, simple as that, does so rapidly because the event is firing rapidly as i move the mouse

Pencil creates a line from the first point to a second point. So a line is created with the data of 2 triggers, being oldpos and newpos. After every line the newpos is set to oldpos and awaits the next trigger for newpos to repeat the process.

Pencil was my effort trying to fix this (while also keeping brush since they look completely different. However both tools still have this problem, albeit being alot more prominent on Brush.)

lucid saddle
#

i don't know if this works but you could try like draw from the clientside instead of sending your mouse position everytime, store the inks drawn from your client into a table via table.insert and when you stop drawing you can send it to the server, have the server to get the table and then send back the table to the other clients (you need to be not included), other clients can create the inks based from your reference table, do the for i, v in ipairs to simulate of that drawing effect

#

i hope you understand

#

firing event do be quick but still takes time

#

i don't know about the mouse move event whether if its accurate or not i have never used it in my coding stuff

copper ridge
#

i see

#

does that really improve the rates of which the mouse.move triggers though?

#

by that logic i feel like it'd only create a slight delay as an offset