Mouse lags behide the object when dragging

Hi ,
I am looking at the Collection of examples from discourse.threejs.org
https://hofk.de/main/discourse.threejs/2019/RestrictDragControls/RestrictDragControls.html.

Since we are restricting the objects y position, the mouse and the object positions are not in sync. My question here is can we position the mouse as we drag the item?

No that would be pretty bad. I’m not sure what lag you’re experiencing that relates to the restriction, but there is a general lag between the hardware cursor and using the coordinates from the mouse move event.

To fix this you should use a cursor either rendered on canvas or using a element placed at the move event position to stay sync. (and hide the cursor via css cursor: none;)

1 Like