# Adding up/down movement to the FreeCamera

**URL:** <https://forum.babylonjs.com/t/adding-up-down-movement-to-the-freecamera/8698>\
**Category:** Feature requests\
**Created:** [February 20, 2020, 8:50am UTC](https://forum.babylonjs.com/t/adding-up-down-movement-to-the-freecamera/8698 "2020-02-20T08:50:34Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![PetterG](https://avatars.discourse-cdn.com/v4/letter/p/ee7513/32.png) [@PetterG](https://forum.babylonjs.com/u/PetterG)\
**Post date:** [February 20, 2020, 8:50am UTC](https://forum.babylonjs.com/t/adding-up-down-movement-to-the-freecamera/8698/1 "2020-02-20T08:50:34Z")

</div>

It would be great if you could assign up/down keys to the FreeCamera. Meaning that the camera would go up and down.

[I created a pull request for this, but it was rejected.](https://github.com/BabylonJS/Babylon.js/pull/7685) What do I have to change do to get it approved?

[I have removed the forward/up naming](https://github.com/Pheater/Babylon.js/commit/b4fce9ac876c4e5c9f61062463ac4f022eecdc15), maybe this version will have a higher chance of being approved.

---

<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:** [February 20, 2020, 9:38am UTC](https://forum.babylonjs.com/t/adding-up-down-movement-to-the-freecamera/8698/2 "2020-02-20T09:38:13Z")

</div>

Looking at the commits I think there is some confusion here. In the code keysLeft, keysRight, keysUp and keysDown were probably originally named after the specific keys on the keyboard, ie the left, right, up and down arrows, not the direction the camera moves. So we do have keysUp are those moving the camera forward, in the z direction, keysDown are those moving the camera backwards, in the -z direction. What I think @PetterG wants to add are an arrays of keys that move the camera in the y and -y direction. So perhaps a better system might have been keysForward, (z) keysBackward, (-z) keysLeft, (-x) keysRight, (x) keyUp (y) and keysDown (-y) however for backward compatibility this renaming is not possible.

Any more thoughts on this?

---

<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:** [February 20, 2020, 10:03am UTC](https://forum.babylonjs.com/t/adding-up-down-movement-to-the-freecamera/8698/3 "2020-02-20T10:03:24Z")

</div>

Hi Petter,

1st - Thanks for the PR, we always appreciate participation from the wonderful community.

4.1 release is right around the corner. We are in code freeze and apart from bug fixes, no new code is being merged.  
I do understand what you were trying to achieve - movement in all 3 Axis - left-right in X, up-down (keyboard up-down) in Z and another keyset for the Y axis. It is just the wrong time right now.

---

<div class="post-metadata">

**Author:** ![PetterG](https://avatars.discourse-cdn.com/v4/letter/p/ee7513/32.png) [@PetterG](https://forum.babylonjs.com/u/PetterG)\
**Post date:** [February 20, 2020, 11:27am UTC](https://forum.babylonjs.com/t/adding-up-down-movement-to-the-freecamera/8698/5 "2020-02-20T11:27:54Z")

</div>

Damn, I really needed this feature. It’s quite a pain to rewrite this in the client side. Especially with typescript. Now I have to wait for like a year for BabylonJS 4.2.

---

<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:** [February 20, 2020, 11:31am UTC](https://forum.babylonjs.com/t/adding-up-down-movement-to-the-freecamera/8698/6 "2020-02-20T11:31:23Z")

</div>

Our preview versions are stable. The only difference is that new API introduced in 4.2 might change until 4.2 will be final.

I always use preview versions when developing.

Shouldn’t be hard to implement, actually. Especially since it is using the \_localDirection variable of the camera (which is public but hidden)

---

<div class="post-metadata">

**Author:** ![AbUser](https://avatars.discourse-cdn.com/v4/letter/a/bc8723/32.png) [@AbUser](https://forum.babylonjs.com/u/AbUser)\
**Post date:** [February 20, 2020, 11:37am UTC](https://forum.babylonjs.com/t/adding-up-down-movement-to-the-freecamera/8698/7 "2020-02-20T11:37:13Z")

</div>

Not hard, but messier.

---

<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:** [February 20, 2020, 4:12pm UTC](https://forum.babylonjs.com/t/adding-up-down-movement-to-the-freecamera/8698/8 "2020-02-20T16:12:21Z")

</div>

Well I would also argue that dumping a PR without discussing about it was not a good idea. Furthermore when you criticize the API 😉

There was a reason behind the naming (explained by @JohnK on your PR: [Removed improved naming · Pheater/Babylon.js@b4fce9a · GitHub](https://github.com/Pheater/Babylon.js/commit/b4fce9ac876c4e5c9f61062463ac4f022eecdc15#commitcomment-37395684))

That being said I could be ok to merge your PR as I do not think it will hurt the release (and I do need to publish a RC4 anyway).

Can we name them keysYUp and keysYDown maybe?

---

<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:** [February 20, 2020, 4:29pm UTC](https://forum.babylonjs.com/t/adding-up-down-movement-to-the-freecamera/8698/9 "2020-02-20T16:29:34Z")

</div>

Another issue with keys for +Y and -Y, what are the natural default keys? The up arrow key and down arrow key lie naturally in the horizontal plane of the keyboard and indicate movement in the +Z and -Z directions, similarly for the left and right arrow keys.

Possible candidates could be \< and \> as they do appear to give some indication of direction???

---

<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:** [February 20, 2020, 5:06pm UTC](https://forum.babylonjs.com/t/adding-up-down-movement-to-the-freecamera/8698/10 "2020-02-20T17:06:18Z")

</div>

Or pageup page down?

---

<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:** [February 20, 2020, 5:33pm UTC](https://forum.babylonjs.com/t/adding-up-down-movement-to-the-freecamera/8698/11 "2020-02-20T17:33:23Z")

</div>

They seem suitable.

---

<div class="post-metadata">

**Author:** ![PetterG](https://avatars.discourse-cdn.com/v4/letter/p/ee7513/32.png) [@PetterG](https://forum.babylonjs.com/u/PetterG)\
**Post date:** [March 6, 2020, 11:18am UTC](https://forum.babylonjs.com/t/adding-up-down-movement-to-the-freecamera/8698/12 "2020-03-06T11:18:29Z")

</div>

So is this happening?

---

<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:** [March 6, 2020, 12:48pm UTC](https://forum.babylonjs.com/t/adding-up-down-movement-to-the-freecamera/8698/13 "2020-03-06T12:48:20Z")

</div>

> [@Deltakosh](#):
>
> That being said I could be ok to merge your PR

This is an indication for you to go ahead with submitting a PR, taking into account advice from @Deltakosh on naming and default keys. Use a link to above post when submitting.
