Search Unity

  1. Check out our Unite Austin 2017 YouTube playlist to catch up on what you missed. More videos coming soon.
    Dismiss Notice
  2. Unity 2017.2 is now released.
    Dismiss Notice
  3. The Unity Gear Store is here to help you look great at your next meetup, user group or conference. With all new Unity apparel, stickers and more!
    Dismiss Notice
  4. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice
  6. Unity 2017.3 beta is now available for download.
    Dismiss Notice

How to get mouseposition in scene view?

Discussion in 'Scripting' started by jwyoo_stone, Nov 5, 2013.

  1. jwyoo_stone

    jwyoo_stone

    Joined:
    Jul 15, 2012
    Posts:
    12
    I tested, lnput.mousePosition only work in gameview weather edit or run mode.
     
  2. rutter

    rutter

    Joined:
    Mar 21, 2012
    Posts:
    84
  3. jwyoo_stone

    jwyoo_stone

    Joined:
    Jul 15, 2012
    Posts:
    12
    Thanks,I'v got it;
    First I do a crazy thing
    use user32.dll API,Find the window handler,then get the client rect and globale mous postion. at last it works!
    but use
    Editor.OnSceneGUI() ,
    Event.current,
    are vary easy to reach this.
     
  4. JudeJohan

    JudeJohan

    Joined:
    Nov 4, 2014
    Posts:
    1
    Bump, how did you manage to do this? Literally zero info of this on interwbz:(
     
  5. wuzibu

    wuzibu

    Joined:
    Dec 15, 2014
    Posts:
    8
    Last edited: Oct 3, 2015
    Xaon and glitchers like this.
  6. glitchers

    glitchers

    Joined:
    Apr 29, 2014
    Posts:
    42
    Xaon and rakkarage like this.
  7. Dmsotir

    Dmsotir

    Joined:
    Feb 12, 2013
    Posts:
    43
    what kind of script does this go in? editor script? I cant seem to get it to work. its saying Event.curent.mousePosition is null...
     
  8. glitchers

    glitchers

    Joined:
    Apr 29, 2014
    Posts:
    42