Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Double click in WebGL game window causes issues on EDGE

Discussion in 'Web' started by unisip, Apr 9, 2019.

  1. unisip

    unisip

    Joined:
    Sep 15, 2010
    Posts:
    340
    Hi, I have this Unity WebGL that builds just fine (using 2018.2) and works well in Chrome but I am having issues on EDGE (on PC).

    The game requires double clicks, and it seems that the event is passed to the webpage or something, because after a double click in the game frame, my next click and drag inside the game frame actually drags the whole frame.
    I'm using an unmodified HTML page generated by the Unity build.

    Is there any way I can prevent this odd behavior?

    As a reference, here is the HTML:

    <!DOCTYPE html>
    <html lang="en-us">
    <head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Unity WebGL Player | MyGame</title>
    <link rel="shortcut icon" href="TemplateData/favicon.ico">
    <link rel="stylesheet" href="TemplateData/style.css">
    <script src="TemplateData/UnityProgress.js"></script>
    <script src="Build/UnityLoader.js"></script>
    <script>
    var gameInstance = UnityLoader.instantiate("gameContainer", "Build/BuildWebGL.json", {onProgress: UnityProgress});
    </script>
    </head>
    <body>
    <div class="webgl-content">
    <div id="gameContainer" style="width: 960px; height: 600px"></div>
    <div class="footer">
    <div class="webgl-logo"></div>
    <div class="fullscreen" onclick="gameInstance.SetFullscreen(1)"></div>
    <div class="title">MyGame</div>
    </div>
    </div>
    </body>
    </html>
     
  2. unisip

    unisip

    Joined:
    Sep 15, 2010
    Posts:
    340
    Come on, nobody but me has this problem on EDGE? :)
    The browser catching mouse events eratically?