How can I active keysUpward and keysDownward

Hello

I want to use universal camera as a camera like google map. I mean I want to move on x and z axis with keyboard and then use mouse scroll wheel for zoom in/out, but by default it moves on x axis and y axis. how can I customize the universal camera to move up and down and also move on z axis.

here is my map PG: https://playground.babylonjs.com/#X2ULQN#43

I’m still a newbie, but I was just digging into this trying to replace the x motion. I don’t know if it’s the “right” way, but this works:

    // Swap y and z key mappings
    const oldKeysUp = camera.keysUp;
    const oldKeysDown = camera.keysDown;
    camera.keysUp = camera.keysUpward
    camera.keysDown = camera.keysDownward
    camera.keysUpward = oldKeysUp
    camera.keysDownward = oldKeysDown

Updated playground:
https://playground.babylonjs.com/#X2ULQN#44

1 Like

Hi @richardtallent

Thank you so much for helping, But it does not work for me, is it work for you?

Unless I misunderstood what you were asking for, the playground version I linked is working – left/right arrows pan west/east, and up/down arrows pan north/south. (PageUp/PageDown are set to zoom.)

1 Like

Sorry for that, my playground was at 4.1 version, I’m so sorry, thank you so much :pray: :pray: :pray: :pray: