1. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice
  2. We're looking for feedback on Unity Starter Kits! Let us know what you’d like.
    Dismiss Notice
  3. We’re giving 2017.1 beta testers a chance to win t-shirts and a Nintendo Switch. Read more on the blog.
    Dismiss Notice
  4. We want to know how you learned Unity! Help us by taking this quick survey and have a chance at a $25 gift card
    Dismiss Notice
  5. Are you an artist or level designer going to Unite Europe? Join our roundtables there to discuss artist features.
    Dismiss Notice
  6. Unity 5.6 is now released.
    Dismiss Notice
  7. Check out all the fixes for 5.6 on the patch releases page.
    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
    glitchers likes this.
  6. glitchers

    glitchers

    Joined:
    Apr 29, 2014
    Posts:
    42
    rakkarage likes 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