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

Mouse leaves screen detect for windows export

Discussion in 'Windows' started by gudula, Feb 14, 2017.

  1. gudula

    gudula

    Joined:
    May 20, 2015
    Posts:
    125
    hi
    my code
    Code (csharp):
    1.  
    2.     float mouseX = Input.mousePosition.x;
    3.     float mouseY = Input.mousePosition.y;
    4.     float screenX = Screen.width;
    5.     float screenY = Screen.height;
    6.    
    7.     if (mouseX < 0 || mouseX > screenX || mouseY < 0 || mouseY > screenY)
    8.         return;
    9.  
    Does not run on visual studio for the windows store export. Anybody know why?
     
  2. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,643
    What do you mean by "does not run"? What it is supposed to do?
     
  3. gudula

    gudula

    Joined:
    May 20, 2015
    Posts:
    125
    When you mouse leaves the VS Studio unity3d screen I want it to stop my camera. Works on unity3d
     
    Last edited: Feb 16, 2017
  4. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,643
  5. gudula

    gudula

    Joined:
    May 20, 2015
    Posts:
    125
    ok thanks from Louis
     
    Last edited by a moderator: Feb 20, 2017
  6. gudula

    gudula

    Joined:
    May 20, 2015
    Posts:
    125
    Any examples of this please?