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. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    Dismiss Notice

Mouse position doesn't always update in OnSceneGUI (custom editor)

Discussion in 'Editor & General Support' started by MCrafterzz, Jun 17, 2018.

  1. MCrafterzz

    MCrafterzz

    Joined:
    Jun 3, 2017
    Posts:
    354
    Hello. I'm displaying a object using Handles.CylinderCap(). I get the mouse position with Event.current.mousePosition but it doesn't seem to update when moving the mouse. Printing the eventtype prints MouseMove so I don't understand why it doesn't update. I can't use EditorWindow.wantsMouseMove either as it's a custom editor and not a custom editor window. What should I do? I have searched but haven't found a answer. Thanks for help.
     
  2. HeavyMetalSnail

    HeavyMetalSnail

    Joined:
    Jun 12, 2018
    Posts:
    13
    Try using Input.mousePosition as a workaround maybe
     
  3. MCrafterzz

    MCrafterzz

    Joined:
    Jun 3, 2017
    Posts:
    354
    That doesn't work at all
     
  4. MCrafterzz

    MCrafterzz

    Joined:
    Jun 3, 2017
    Posts:
    354
    Input.mousePosition always returns 0, 0, 0 in OnSceneGUI in my custom editor. Any solution to this?
     
  5. MCrafterzz

    MCrafterzz

    Joined:
    Jun 3, 2017
    Posts:
    354
    Bump. Really need this fixed!
     
  6. dimetcm

    dimetcm

    Joined:
    Dec 5, 2012
    Posts:
    8