[Need Help] Webgl build input position is incorrect/offset

Here’s my issue, in one of my scenes in my webgl build, when clicking on anything, the input position is wrong where if I want to click on a button, I have to somehow guess by clicking somewhere outside the button’s ‘input box’.

Here’s the build:
https://iluvsnowlc.github.io/WebglTest/

This issue only happens in chrome including for android and only happens on the second scene after clicking start. The first scene is all fine where the mouse cursor position seems to be correct. The editor view is also fine.

I am using Unity 2019.4.6f1, it was upgraded several times to this version as this problem persisted in previous versions. Components such as canvas scaler, eventsystem and camera are the same in the first scene and second.

Any help would be greatly appreciated!

Hi @iluvsnowlc ,

If the issue is happening on the second scene, but not in the first one, it seems that maybe is not reset properly.

Have you tried to only include your second scene on the build and test it without the first scene?

If not, would you mind trying?

Thanks!

Yes I have tried only building with second scene, the problem still persists only in chrome, it also happens even in the default webgl template.

Ok, that sounds like a bug.

Would you mind to report it by following these instructions: Unity QA: Building quality with passion

In that way, the bug can be properly checked and solved.

Thank you!

Hi, there.

Noob here, but I guess it might help giving another input on this issue.

For me it only happens in android/chrome, but consistently, regardless of scene. Android/firefox seems to render just fine.

My webgl-content div set at width: 100% and height: 100% caused the exact same issue. I’ve fixed it by setting the height to a fixed resolution (in my case 1200px).

If my understanding is correct, chrome on android is unable to get the right height for the canvas and render the hit areas in a scaled position, even if they render graphically correct.

Hope it helps!

I second akiyamae. Unity 2019.4.28f1, setting width and height to 100% on android chrome makes button click area differ from visuals but works fine on adroid firefox