Camera angle speed in Playground Example


I am curious to know why is the camera angle speed cumulative in the below playground example:

Each time the script is run using the triangle or reloading the page the camera angle speed associated with left and right arrow keys input increases?

That’s because you don’t remove the event listeners, so each time you hit the “play” button a new listener is added over the previous one.

You should detach the controls on scene.onDisposeObservable, for eg, to start each time from a clean state.

1 Like