Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Question OnGUIfunction on my EditorWindow update the values late

Discussion in 'Editor & General Support' started by AlexMcWhit, Nov 9, 2023.

  1. AlexMcWhit

    AlexMcWhit

    Joined:
    Sep 26, 2020
    Posts:
    13
    hello guys I am working on custom editor and I face this problem. When I debug those values on the picture they are changing but the slider react to the changment of the values soooo late.


    also you can see this video the debug change but the slider values didn't change.




    and this is the full code
    www.paste.ofcode.org/3adp4atJhJLeFarSPc7LQ6d
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    7,010
    Perhaps this is because you react only to the ScrollWheel event but you use some sort of "mouse value" which may not actually be the scroll wheel movement but rather the mouse position delta?

    Something tells me that combining the Event.current with controls is probably not the right way to do it.
     
  3. AlexMcWhit

    AlexMcWhit

    Joined:
    Sep 26, 2020
    Posts:
    13
    it's not the problem even tho when I test it multiple times I am sure that that value refer to the actual wheel movement.
    The problem is the value is changing on debug but it's not changing on the actual EditorGUILayout.MinMaxSlider