Search Unity

Unity WebGL disables Page Scrolling

Discussion in 'Web' started by alexander_hess, Feb 16, 2016.

  1. alexander_hess

    alexander_hess

    Joined:
    Feb 16, 2016
    Posts:
    2
    Hey,

    we exported a Unity Project to WebGL and inculed it into a longer HTML page.
    Everything works as expected. The only problem is, if the mouse is over the WebGL canvas all Mouse Wheel Events seem to be canceled from the Unity WebGL player. Scrolling the page while the mouse is hovering the WebGL canvas is at the moment impossible.

    Is there an option to prevent Unity from canceling the events?

    Thanks.
     
  2. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    I think WebGLInput.captureAllKeyboardInput is what you are looking for.
     
    savely00 likes this.
  3. chriszul

    chriszul

    Joined:
    Feb 13, 2018
    Posts:
    33
  4. julien-conan

    julien-conan

    Joined:
    Jun 20, 2015
    Posts:
    8
    same question here :) many thanks
    i.e. allow web browser to scroll index page normally over gameContainer
     
  5. TDVDev

    TDVDev

    Joined:
    Mar 25, 2020
    Posts:
    2
  6. alisonma

    alisonma

    Joined:
    Dec 17, 2018
    Posts:
    1
    Does anyone have an updated solution for 2022? Seems like the index.html file generated by Unity 2020.3.37f1 isn't similar to that medium blog post.