# Ignore mouse movement when interacting

**URL:** <https://forum.babylonjs.com/t/ignore-mouse-movement-when-interacting/33168>\
**Category:** Questions\
**Created:** [August 18, 2022, 3:27pm UTC](https://forum.babylonjs.com/t/ignore-mouse-movement-when-interacting/33168 "2022-08-18T15:27:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BoldBigflank](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/boldbigflank/32/4426_2.png) [@BoldBigflank](https://forum.babylonjs.com/u/BoldBigflank)\
**Post date:** [August 18, 2022, 3:27pm UTC](https://forum.babylonjs.com/t/ignore-mouse-movement-when-interacting/33168/1 "2022-08-18T15:27:26Z")

</div>

I’m using a FreeCamera and onPointerObservable/POINTERDOWN events. Is there a way when I sucessfully pick a mesh with the mouse I want to interact with, to stop the freecamera from moving around for the duration of the click?

---

<div class="post-metadata">

**Author:** ![JohnK](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/johnk/32/26764_2.png) [@JohnK](https://forum.babylonjs.com/u/JohnK)\
**Post date:** [August 18, 2022, 3:31pm UTC](https://forum.babylonjs.com/t/ignore-mouse-movement-when-interacting/33168/2 "2022-08-18T15:31:50Z")

</div>

Yes, camera.detachControl()

See [Babylon.js Playground](https://playground.babylonjs.com/#7CBW04)

---

<div class="post-metadata">

**Author:** ![BoldBigflank](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/boldbigflank/32/4426_2.png) [@BoldBigflank](https://forum.babylonjs.com/u/BoldBigflank)\
**Post date:** [August 18, 2022, 3:35pm UTC](https://forum.babylonjs.com/t/ignore-mouse-movement-when-interacting/33168/3 "2022-08-18T15:35:14Z")

</div>

Oh that’s lovely. If I have redundant `camera.attachControl(canvas, true)` functions, it won’t have any negative effects, right? Or is there a way to check whether control has been detached before attaching again?

---

<div class="post-metadata">

**Author:** ![JohnK](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/johnk/32/26764_2.png) [@JohnK](https://forum.babylonjs.com/u/JohnK)\
**Post date:** [August 18, 2022, 5:18pm UTC](https://forum.babylonjs.com/t/ignore-mouse-movement-when-interacting/33168/4 "2022-08-18T17:18:28Z")

</div>

> [@Check if controls attached to camera?](https://forum.babylonjs.com/t/check-if-controls-attached-to-camera/26544):
>
> Hi There, I was trying to check if the controls are attached to the current camera, to be able to toggle controls on or off. export const CanvasControlToggleBtn = function (scene:Scene) { var advancedTexture = AdvancedDynamicTexture.CreateFullscreenUI("UI"); var button1 = Button.CreateSimpleButton("but1", "ON"); button1.width = "150px" button1.height = "40px"; button1.color = "white"; button1.cornerRadius = 20; button1.background = "green"; var attached = scene.…

This may help.
