- Home /
Displaying tooltips hint for variables in inspector
Hi to all.
Is it possible for variables in our script to have tooltips and when in inspector we hold mouse over them ,their tooltip be displayed,just like standard unity components(i.e. light component)?
Answer by instruct9r · Jul 18, 2015 at 11:43 PM
For anyone still wondering about this, it's been added to Unity: Just use:
[Tooltip("The information that will be displayed")]
Above the definition of the variable, to which you want to add a Tooltip...
I tried this, but it just will be displayed always even not hovering with the mouse on the inspector attribute field. I used it the same way you posted it, is there something i am doing wrong? Or is it a bug in the unity editor?
Answer by roojerry · May 22, 2013 at 02:56 PM
There is Pimp My Editor: Tooltips in the Asset Store for this kind of thing
Thanks for reply,but i cant buy from asset store,therefore i search for a way to Implement it myself. I would welcome any help.
Well I did a bit off digging and learning and found that its not too terribly hard to get tooltips to show up in editor windows.
EditorGUILayout.IntField(new GUIContent("VariableName", "tooltip"), intValue);
Fromt there, however, you will need to write a Custom Inspector to handle the variables you want tooltips for.