Move forward in universal camera not working in Chrome

when I press mouse left button (pointerdown event), hold and forward to move, it works in Safari but It doesn’t forward camera in Chrome (Version 84.0.4147.105 (Official Build) (64-bit)):

Babylon.js v4.2.0-alpha.29 - WebGL1

https://www.babylonjs-playground.com/#46S4CK

it works for me on Windows and chrome
Do you have any error in the console?

Same with @Deltakosh . I also checked Firefox and was working.

No error in Console, I am on Mac

There are some verbose errors, not sure its related, I am attaching a screenshot

Nope
Pinging @Cedric to test on Chrome Mac

No luck for me. tested on Chrome mac with the exact same version and it works

I am adding a video below of this behaviour
http://www.mediafire.com/file/5zmafqwgl1lvx7z/Screen_Recording_2020-08-05_at_11.45.24_AM.mov/file
on the right side is safari working, on left chrome just move object up/down instead going forward.

I included a snippet to track events:
https://www.babylonjs-playground.com/#46S4CK#1

document.addEventListener('pointerdown', () => {
  console.log('pointerdown')
});
document.addEventListener('pointerup', () => {
  console.log('pointerup')
});

to be sure, when you press the up key to move forward while the left mouse button is down, then the camera doesn’t move ?
I did another try and it works for me. Can you try to add a key event listener ?

I am not pressing any keyboard button, I left click mouse and move forward while the left mouse button is down, no keyboard button is pressed before or after.

when moving mouse with left button down the camera will rotate, not move. What am I missing?

I have uploaded a video of this issue on youtube, https://youtu.be/tPuHctwQh6U

on left it shows chrome and on right safari, you could see in console inside video, I am clicking left of mouse and dragging but it is different behaviour on each browser.

alright, then the issue is with Safari not Chrome.

but for me I want Safari behaviour to happen on left mouse and drag forward, this way I can easily walk around the scene, only rotation will become issue in universal camera.

ps. it also rotates when I am dragging mouse up/down and forward on safari, which is good.

I can repro the issue and will fix it with Safari. Until a fix is release, you can add:

camera.touchMoveSensibility = 0;

for a workaround.
To move the camera with the mouse, you’ll have to add a mousemove event and change the position when the mouse button is down.

2 Likes

Thank @Cedric, I will try that with my limited knowledge I gained in last two weeks, I have learned a lot these days, so many resources here, Now I was learning about Cameras and encountered this.

1 Like

PR is live: Check Event Type Touch input Camera by CedricGuillemet · Pull Request #8707 · BabylonJS/Babylon.js · GitHub

1 Like