# How to move the camera in the direction the camera is facing?

**URL:** <https://forum.babylonjs.com/t/how-to-move-the-camera-in-the-direction-the-camera-is-facing/21307>\
**Category:** Questions\
**Created:** [June 1, 2021, 3:27am UTC](https://forum.babylonjs.com/t/how-to-move-the-camera-in-the-direction-the-camera-is-facing/21307 "2021-06-01T03:27:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AjaxGodfather](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@AjaxGodfather](https://forum.babylonjs.com/u/AjaxGodfather)\
**Post date:** [June 1, 2021, 3:27am UTC](https://forum.babylonjs.com/t/how-to-move-the-camera-in-the-direction-the-camera-is-facing/21307/1 "2021-06-01T03:27:24Z")

</div>

I have a playground saved here:  
[Moving the Camera | Babylon.js Playground (babylonjs.com)](https://playground.babylonjs.com/#MNB4CR)

I’m using a gamePad Camera and a render loop in the example and moving the camera along the z axis at the speed of the camera. How can I apply a constant force to propel the camera to move in the direction the camera is facing?

---

<div class="post-metadata">

**Author:** ![jelster](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jelster/32/25881_2.png) [@jelster](https://forum.babylonjs.com/u/jelster)\
**Post date:** [June 1, 2021, 3:49am UTC](https://forum.babylonjs.com/t/how-to-move-the-camera-in-the-direction-the-camera-is-facing/21307/2 "2021-06-01T03:49:45Z")

</div>

Hi AjaxGodfather (little, big, or clean variety of Ajax? 😃 ),

You can essentially combine your calculation and translation steps by using `camera.getFrontPosition(distance)`. Pass in the distance in front of the camera that you’d like to move (e.g., the speed in a render loop) and it will return a Vector3 with the position that would represent. You can just set the camera’s position directly from there if you want.

HTH
