Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

double click not working in WebGL build

Discussion in 'WebGL' started by Deleted User, Jun 16, 2015.

  1. Deleted User

    Deleted User

    Guest

    Hello,

    in my application, I have code that handles clicks on UI text objects. While single clicks are detected, double clicks are not. This is the code

    Code (CSharp):
    1. public void HandleClick (BaseEventData eventData)
    2.     {
    3.  
    4.         PointerEventData e = (PointerEventData)eventData;
    5.  
    6.         GameObject selected = e.pointerPress; // the newly selected object label
    7.  
    8.         // do something for single click
    9.        
    10.         if (e.clickCount == 2) {
    11.  
    12.             do something for double click
    13.         }
    14.  
    15.     }
    This code works perfectly for standalone or web player builds ... any idea?

    UPDATE: it seems if I perform triple or quadruple clicks, some of them are actually registered as double clicks... but not always.

    I am using Unity 5.1.0f3 on Mac OS X Yosemite, latest version. Same problem with Firefox, Safari, and Chrome (latest version for each of them).

    Any help would be very appreciated!
     
  2. prestonmatterport

    prestonmatterport

    Joined:
    May 7, 2015
    Posts:
    28