BabylonJS Documentation's example error

hello everyone!

lately, i am trying to create a FreeCamera, detach the keyboard-moving control and make the cursors to rotate the axis - so if i will pres left-key i will turn (or rotate) to the left

so i read here BabylonJS docs - Customize Camera Inputs - Babylon.js Documentation

and they are doing an example for what i just described, but the problem is that it is not working for me, and also it is not working in their own playground-example

can anyone help so i will be able to see a working example and understand what is needed to be done? :smiley:
thanks in advanced for everyone!

Hello and welcome to the forum!

The PG example is good for 3.3 version. (change version at the right top corner)

But I suppose you may just use Universal Camera which supports left-right cursor movement by default.
https://doc.babylonjs.com/babylon101/cameras#universal-camera

You’re right, the doc’ have to be update.

All updated the RegisterTopRootEvents has changed.

1 Like

Hi, Thank you for the fast answer!
But do you know what i need to change in order to make it work in the latest version of babylonjs?

Can you link a PG that does not work with latest?

You need to pass the canvas as well in the register and unregisterTopRootsEvents functions

it works! thank you very much! :smiley: