How to adjust camera keyboard rotation speed?

Hi, I was using the ArcRotationCamera and was able to adjust the mouse camera and zoom with the camera properties, but was unable to find a way to change the rotation speed with the keyboard controls. Could someone help and give me some direction on how to approach this?

Thanks

Hiya Z… welcome to the forum! Sorry for the slow replies.

Give this a try:

camera.inputs.attached.keyboard.angularSpeed = .002;

https://playground.babylonjs.com/#PU4WYI#119 (see line 12)

That should work, and won’t change mouse-panning speeds/sensibility/sensitivity (a good thing). :slight_smile:

The .inputs property is an interesting “behaviors-like” system… which accepts “input modules”. When we “drilled” into camera.inputs.attached.keyboard depth… well, you know. We went onto the arcCam’s keyboardInput module.

We can examine a certain BabylonJS SOURCE CODE folder and see all the camera input modules/plugins. We adjusted a value on the arcRotateCameraKeyboardMoveInput.ts module.

I hope I have told you wisdom… but I am no expert. Fellow forum helpers… fix my words if I have said something incorrect or poorly. Thx.

Z, if you have more questions about this, just holler. Mark as solved, if appropriate. And again, welcome… good to have you with us.

2 Likes

Thank you very much! It worked perfectly :slight_smile:

1 Like