Prevent OrbitControls from pausing rotation on mouse down/click


I’m trying to detect the closest and visible Object3D mesh on mouse click. The problem is each time I do that, the OrbitControls pauses for a quick moment before resuming its auto rotation. How do I prevent that sudden quick pause? I tried disabling the controls on mousedown, but that did not prevent the the pause in rotation. Oh yeah, I don’t want to do the auto rotation manually in the animate() loop either, that would be too easy. :slight_smile:

the easiest is usually the best. autorotate works as it’s supposed to, when you click it stops as it must. registering events before controls and stopping propagation to prevent it is shaky but would probably work. though before you go through all that trouble, why not spin the model inside the render loop?

1 Like

Yeah, I tried to do .preventDefault(), .stopPropagation(), but the mesh still stops rotating while my mouse is down. I don’t want to manually rotate the object since the OrbitControls is already handling that task internally. Well then, I assume there is no way to do this other then manually controlling the spin inside the render loop.

this is probably because orbit is getting events first, it’s a race condition and that’s why i’d shy away from it, it depends on which of the two comes first and that’s nothing you want to build upon.