I’m having problems implementing the steering of the player in my current project.
Left mouse button should trigger firing, right mouse button should trigger acceleration.
It already works to a certain degree, but I’m struggling to implement the behavior that when the right mouse button (acceleration) is held down it still is possible to trigger fire with left mouse button without stopping acceleration. Here is a playground which only implements non-simultaneously pressed buttons https://playground.babylonjs.com/#T4MJ6I#3. The left box indicates firing with CCW rotation, the right box indicates acceleration with CW rotation.
According to MouseEvent.buttons - Web APIs | MDN the
event.buttons property indicates simultaneously pressed buttons which probably can be used to aceive what I’m looking for. But all attempts messing around with this property failed. Maybe someone already has done something similar in the past and could modify the playground.
Any help appreciated!