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

OnMouseDown is not invoked for the first click in WebPlayer

Discussion in 'Editor & General Support' started by support, Nov 9, 2014.

  1. support

    support

    Joined:
    Oct 24, 2013
    Posts:
    19
    OnMouseEnter and OnMouseExit work fine. However, if player clicks, the first click does not make effect. The second click works. Actually, it does not mater where to click for the first time. It looks like the WebPlayer is not in focus. In the same time, working OnMouseEnter and OnMouseExit point to the fact that WebPlayer listen the mouse events in general. Debug.Log(Input.mousePosition) inside the Update() also prints out the current position.
    Is it a way to detect the first click?
     
  2. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    I only experienced that in Safari and there was no actual solution I found, except for explicitly asking the player to click first (in Safari only).
     
  3. support

    support

    Joined:
    Oct 24, 2013
    Posts:
    19
    Does not work in Crome (at least on Mac)