[Babylon.js v4.1.0-beta.24] ArcRotateCamera doesn't change view with mouse movement in Safari, but works fine in Chrome

I cloned @renjianfeng’s BabylonTPSDemo, which uses Babylon.js v3.1-alpha and the ArcRotateCamera works perfectly in Chrome/Windows and Safari/Mac. However, when I change its index.html to use Babylon.js v4.1.0-beta.24, the ArcRotateCamera only responds to mouse movement in Chrome/Windows and fails to respond on Safari/Mac.

Please refer to the same playground in the Question: Raycast to check if player is standing on ground. This is a simplified version of @renjianfeng’s demo. Again, ArcRotateCamera only responds to mouse movement in Chrome/Windows and fails to respond on Safari/Mac.

The canvas.requestPointerLock() method seems to be working on Safari/Mac. But after activating pointer lock by clicking inside the scene, ArcRotateCamera doesn’t rotate according to mouse movements in Safari/Mac.

I can’t really test it because I don’t currently have a mac next to me, but can I ask why you are using an alpha version of 4.1? have you tried this with latest 4.2 alpha? or with 4.1 stable? does it react the same?

1 Like

Pinging @cedric who may be able to test

1 Like

I can repro the issue!

2 Likes

Thank you for checking in, @RaananW! As you mentioned, I should have updated to 4.2 in my local environment. However, according to the console log, it seems that the Playground uses Babylon.js v4.2.0-alpha.9 and has a similar issue on Safari/Mac.

Thank you @Deltakosh and @Cedric for helping repro the issue!

I should have mentioned earlier: ArcRotateCamera behaves as expected on Chrome/Mac (and Chrome/Windows), but not on Safari/Mac.

1 Like

Sounds good! I’ll try to find a fix next monday.

1 Like

I filled an issue [Input] PointerEvents and Safari · Issue #7995 · BabylonJS/Babylon.js · GitHub

2 Likes

Hi, shouldn’t the types for PointerInfo be updated? it seems that event now should rather be of type:

event: PointerEvent | MouseEvent | MouseWheelEvent;

Otherwise for desktop safari using pointer event specific fields (like pointerId) would lead to bugs since they’re not defined for mouse events :thinking:

1 Like

IIRC, @sebavan did some changes regarding this issue.

1 Like

I agree the typings might not be fully adequate but it is normally all handled in the input manager.

1 Like

I have scenes working great in all browsers except safari which won’t rotate the arc-rotate camera. Everything else seems to work great. It doesn’t work with touchpad or mouse even with the default playground scene. I’ve attached a screenshot of the errors that come up with the default scene. I think this issue was closed from before, so not sure if it’s a bug that’s come up again? I’m not usually a Mac user, but its a requirement for our application to work with all standard browsers. I’m using safari Version 14.0.3 (15610.4.3.1.6, 15610). Any guidance would be most appreciated. I’m a 3D modeler who has recently been thrown into developing for web, so apologies if I’m missing something obvious.