Looking for the keyboard control method for UniversalCamera

Hello again :slight_smile:
I am trying to recreate what the keyboard control does with the camera when I use the default
camera.attachControl()
as seen here: Babylon.js Playground
So I can have the same thing happen when I use the mouse / touch interface.
It is a kind of side movement I am looking for.

Any ideas where I can look?
Thanks

EDIT:
Never mind, I have found it in the source
https://playground.babylonjs.com/#2A2377#1

Yep, this playground overrides the FreeCameraKeyboardMoveInput class, which in turn is in charge of the keyboard input processing. You can write your own instead of prototype-manipulating the existing class.

You can read about it here:

Customizing Camera Inputs | Babylon.js Documentation (babylonjs.com)

Yes, this is what I did. According to that Customizing Camera Inputs page.
However the tricky thing is that I nee to create my own FreeCameraMouseInput and copy the functionality of that FreeCameraKeyboardMoveInput with it.
So when you drag left it behaves in the same as if I had pressed the left key.

Is this the same issue that we’re discussing in the other thread, or a separate one?

Well it was meant as a different one. But things developed in a way that I think this one can be closed.

1 Like