BABYLON.VirtualJoystick.Canvas size

Hi, I am using BABYLON.VirtualJoystick.Canvas. All I want is to use the joystick on the right part of the screen, that is, on the canvas, but when I use this code ‘BABYLON.VirtualJoystick.Canvas’, I can use the joystick on the whole screen. How can I solve this without using z-index? Please your help.

Babylon.js Playground (

I set the height and width options but this causes a different problem. When I touch the screen, the joystick exists in a different place.

Babylon.js Playground (

Currently, the VirtualJoystick only supports a canvas that covers the entire window, and it’s not possible to change its size (as whenever it resizes it looks at the size of the whole window).


You may be right. I couldn’t find a solution for this. Thank you for your answer.