# Scene isPointerCaptured returns undefined inside onPointerMove method

**URL:** <https://forum.babylonjs.com/t/scene-ispointercaptured-returns-undefined-inside-onpointermove-method/57805>\
**Category:** Bugs\
**Created:** [April 13, 2025, 1:24pm UTC](https://forum.babylonjs.com/t/scene-ispointercaptured-returns-undefined-inside-onpointermove-method/57805 "2025-04-13T13:24:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Khanon](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/khanon/32/14980_2.png) [@Khanon](https://forum.babylonjs.com/u/Khanon)\
**Post date:** [April 13, 2025, 1:24pm UTC](https://forum.babylonjs.com/t/scene-ispointercaptured-returns-undefined-inside-onpointermove-method/57805/1 "2025-04-13T13:24:48Z")

</div>

Hi,

`scene.isPointerCaptured` always reutrns `undefined` when I call it from `onPointerMove`, no matter whether I click the screen or not.  
Am I missing something?

> **[Babylon.js Playground](https://playground.babylonjs.com/#0IG116%231)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL and WebGPU 3D scenes

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [April 13, 2025, 3:33pm UTC](https://forum.babylonjs.com/t/scene-ispointercaptured-returns-undefined-inside-onpointermove-method/57805/2 "2025-04-13T15:33:32Z")

</div>

As said in the [Docs](https://doc.babylonjs.com/typedoc/classes/BABYLON.Scene#ispointercaptured), “`scene.isPointerCaptured` gets a boolean indicating if the current pointer event is captured (meaning that the scene has already handled the pointer down)”. This is useful when you want to determine whether user interactions (e.g., clicks, touches) are being handled by Babylon.js or if they should be processed by other parts of your application (e.g., UI elements outside the canvas).  
It has the parameter pointerId, so this will work in your PG with click and hold (pointerDown)

```auto
scene.isPointerCaptured(1)

```

Example - [https://playground.babylonjs.com/#0IG116#5](https://playground.babylonjs.com/#0IG116#5)  
(click, hold and move a mouse)

---

<div class="post-metadata">

**Author:** ![Khanon](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/khanon/32/14980_2.png) [@Khanon](https://forum.babylonjs.com/u/Khanon)\
**Post date:** [April 13, 2025, 3:46pm UTC](https://forum.babylonjs.com/t/scene-ispointercaptured-returns-undefined-inside-onpointermove-method/57805/3 "2025-04-13T15:46:28Z")

</div>

I expected 0 to be equivalent to left mouse button.

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [April 13, 2025, 4:20pm UTC](https://forum.babylonjs.com/t/scene-ispointercaptured-returns-undefined-inside-onpointermove-method/57805/4 "2025-04-13T16:20:59Z")

</div>

In this case it is `DeviceType.Mouse`, left click may be derived from `event.button`

> <https://github.com/BabylonJS/Babylon.js/blob/1fa51fc7f8268a8cd43b205305ec2fafea2edb82/packages/dev/core/src/DeviceInput/eventFactory.ts#L70>

---

<div class="post-metadata">

**Author:** ![Khanon](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/khanon/32/14980_2.png) [@Khanon](https://forum.babylonjs.com/u/Khanon)\
**Post date:** [April 13, 2025, 4:37pm UTC](https://forum.babylonjs.com/t/scene-ispointercaptured-returns-undefined-inside-onpointermove-method/57805/5 "2025-04-13T16:37:07Z")

</div>

That clears everything. Thanks!
