Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

GameObject On Mouse hover Tooltip Help

Discussion in 'Scripting' started by Mihai93, Dec 31, 2013.

  1. Mihai93

    Mihai93

    Joined:
    Jul 14, 2012
    Posts:
    213
    How i can i have only a simple tooltip like this



    I need only the script with how to show when i go over a gameobject

    thanks
     

    Attached Files:

  2. Patico

    Patico

    Joined:
    May 21, 2013
    Posts:
    886
    Something like this:
    Code (csharp):
    1.  
    2.     bool show = false;
    3.    
    4.     void OnMouseOver()
    5.     {
    6.         show = true;
    7.     }
    8.     void OnMouseExit()
    9.     {
    10.         show = false;
    11.     }
    12.     void OnGUI()
    13.     {
    14.         if(show)
    15.         {
    16.             GUI.Label(new Rect( 10, 10, 200, 30), "+30 Mana");
    17.         }
    18.     }
    19.  
     
    Last edited: Dec 31, 2013
  3. Mihai93

    Mihai93

    Joined:
    Jul 14, 2012
    Posts:
    213
    i have this error

    Assets/toolbox.js(1,9): UCE0001: ';' expected. Insert a semicolon at the end.
     
  4. Mihai93

    Mihai93

    Joined:
    Jul 14, 2012
    Posts:
    213
    PLease Help
     
  5. Mihai93

    Mihai93

    Joined:
    Jul 14, 2012
    Posts:
    213
    please help
     
  6. guitarxe

    guitarxe

    Joined:
    Dec 1, 2013
    Posts:
    131
    Patico already provided you with an example of how to solve this logically. It's up to you now to actually write the script. If you do not know how, you can always begin with:
    http://unity3d.com/learn/tutorials/modules/beginner/scripting
    Or explain further what specific problems you are having, not just "giev me teh codez".
     
unityunity