# Camera input null gamepad

**URL:** <https://forum.babylonjs.com/t/camera-input-null-gamepad/14764>\
**Category:** Bugs\
**Created:** [October 8, 2020, 9:22am UTC](https://forum.babylonjs.com/t/camera-input-null-gamepad/14764 "2020-10-08T09:22:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Josip\_Almasi](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/josip_almasi/32/6391_2.png) [@Josip\_Almasi](https://forum.babylonjs.com/u/Josip_Almasi)\
**Post date:** [October 8, 2020, 9:22am UTC](https://forum.babylonjs.com/t/camera-input-null-gamepad/14764/1 "2020-10-08T09:22:28Z")

</div>

Hi,

cameras created after createScene() have null gamepad - until the gamepad is disconnected and reconnected.  
Quick look at how cameras are created, [Babylon.js/freeCameraGamepadInput.ts at master · BabylonJS/Babylon.js · GitHub](https://github.com/BabylonJS/Babylon.js/blob/master/src/Cameras/Inputs/freeCameraGamepadInput.ts) installs onGamepadConnectedObservable that is just not triggered for new cameras.  
Looks more of a design flaw than a bug really.

My workaround for the time being is  
newCamera.inputs.attached.gamepad.gamepad = oldCamera.inputs.attached.gamepad.gamepad  
🙂

So I guess that attachControl() should take existing gamepad from some singleton, in addition to installing event handler.

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [October 8, 2020, 4:25pm UTC](https://forum.babylonjs.com/t/camera-input-null-gamepad/14764/2 "2020-10-08T16:25:59Z")

</div>

adding @RaananW

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [October 8, 2020, 5:27pm UTC](https://forum.babylonjs.com/t/camera-input-null-gamepad/14764/3 "2020-10-08T17:27:39Z")

</div>

good catch! you are totally right. will take care of that 🙂
