Tooltip does not show

I created a button with a tooltip, but when the user mouses over, it does not show.

The tooltip text is "Item:"+items[a].name+"("+items[a].quantity+")"

GUI.Button(new Rect(curx,cury,80,80),GUIContent(items[a].name,items[a].icon,"Item:"+items[a].name+"("+items[a].quantity+")"))

Why does this not work? do i have to do it manually?

The parameters:

  • name is a String
  • icon is a Texture

Add this under it

GUI.Label (Rect (10,40,100,40), GUI.tooltip);

Also read the docs for tooltips.

http://unity3d.com/support/documentation/ScriptReference/GUI-tooltip.html