Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  5. Nominations have been announced for this years Unity Awards. Celebrate the wonderful projects made by your peers this year and get voting! Vote here!
    Dismiss Notice
  6. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  7. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Tooltip works in editor and is crazy in build

Discussion in 'Unity UI & TextMesh Pro' started by Fuzzypup, Dec 6, 2018.

  1. Fuzzypup

    Fuzzypup

    Joined:
    Aug 13, 2013
    Posts:
    104
    When I run my game in the editor the tooltip works 100% correctly.

    When I make a build of my game and run that it doesn't work correctly.

    It's as simple as this..... but hovers with the mouse.
    void OnGUI()
    {
    // Make a button using a custom GUIContent parameter to pass in the tooltip.
    GUI.Button(new Rect(10, 10, 100, 20), new GUIContent("Click me", "This is the tooltip"));

    // Display the tooltip from the element that has mouseover or keyboard focus
    GUI.Label(new Rect(10, 40, 100, 40), GUI.tooltip);
    }



    So in the editor is normally appears hovering over the button or image following the mouse.

    In the build it doesn't show unless I click the button and then it doesn't disappear from the screen but does follow the mouse.

    Why is it working differently from the editor to the build?

    It was working in Unity3d 2017.
    After I upgraded to 2018 it did the above.

    20 later.....

    And now I noticed my GUIStyle code isn't working either..... WTF?!
     
    Last edited: Dec 6, 2018
  2. Fuzzypup

    Fuzzypup

    Joined:
    Aug 13, 2013
    Posts:
    104
    Well I discovered it was a version issue. I put it back to the 2017 build and no issue. So maybe the 2018 version did something with tooltips.
     
  3. Fuzzypup

    Fuzzypup

    Joined:
    Aug 13, 2013
    Posts:
    104
    My Unity 2017 tooltip is simple.

    So I decided to learn how to do it in Unity 2018.

    Why is it so damn complex.

    I have to create a canvas, put something on it, put something on that, adjust 50 different things. Have these sub objects to the text, the canvas the tooltip, modify the sprite in the sprite editor. Have 2 interfaces, have a UI manager, then do other crap.... I finally gave up.

    Can I do it the old way? My way was one line of code. This new way is tedious. I don't need all sorts of fancy features.

    Someone help?

    Mine is so much more simpler but doesnt work in 2018 build.

    Seems like Unity 2018 in build mode isn't holding the tooltip string.
    But also onHover isn't working either for gui.buttons.
     
    Last edited: Dec 7, 2018
  4. Fuzzypup

    Fuzzypup

    Joined:
    Aug 13, 2013
    Posts:
    104
    Only way tooltips and onHover works if is I hold my left mouse button down somewhere else then hover over the buttons that have guicontent.

    WTF?!