# FreeCamera's keyboard input not working if render loop not triggered from engine

**URL:** <https://forum.babylonjs.com/t/freecameras-keyboard-input-not-working-if-render-loop-not-triggered-from-engine/51078>\
**Category:** Questions\
**Tags:** camera\
**Created:** [June 5, 2024, 9:57am UTC](https://forum.babylonjs.com/t/freecameras-keyboard-input-not-working-if-render-loop-not-triggered-from-engine/51078 "2024-06-05T09:57:17Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![xiasun](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/xiasun/32/36884_2.png) [@xiasun](https://forum.babylonjs.com/u/xiasun)\
**Post date:** [June 5, 2024, 12:32pm UTC](https://forum.babylonjs.com/t/freecameras-keyboard-input-not-working-if-render-loop-not-triggered-from-engine/51078/5 "2024-06-05T12:32:19Z")

</div>

I have found out the reason for this behavior. The `FreeCamera` (as well as other cameras) calculates the move speed from the engine’s delta time and FPS. If no render loop has ever been registered to the engine, then the engine’s delta time and FPS will be invalid, so the speed for the camera will always be **zero**.

```javascript
// targetCamera.ts

// Methods
/** @internal */
public _computeLocalCameraSpeed(): number {
    const engine = this.getEngine();
    return this.speed * Math.sqrt(engine.getDeltaTime() / (engine.getFps() * 100.0));
}

```

So the exact behavior is, for all cameras, if `engine.runRenderLoop()` has never been called, then the movement input will be inactive.

As @Tricotou said, we can register an empty function to bypass this problem.

```auto
engine.runRenderLoop(() => {});

```

I personally think this behavior is a little bit confusing. Delta time and FPS should also be available if the user chooses to trigger `scene.render()` or `camera.update()` on their own. (e.g. the [render on demand thread](https://forum.babylonjs.com/t/what-is-the-correct-way-to-render-on-demand/17256/6))

Let’s see if other experts have any suggestions for this.

---

_[View the full topic](https://forum.babylonjs.com/t/freecameras-keyboard-input-not-working-if-render-loop-not-triggered-from-engine/51078)._
