- Home /
PropertyDrawer, empty tooltips
Hi,
I stumbled upon a problem using custom propertyDrawer. It seems that the parameter label of
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
does not receive tooltip information at all. It is always an empty string.
The problem is, I could of course set the tooltip in a custom editor directly instead of using the Tooltip attribute however it defies the purpose of using the PropertyDrawer feature.
Did I missunderstood the concept or is this a bug?
I read on really old threads that this was a known bug (in the beginnings of Unity 5.0). Is this still an unhandled bug? If yes, please fix it as soon as possible, since it makes the very cool PropertyDrawer feature useless if you want to create a clean and consistent Inspector.
Could you file a bug report please with example files?
Answer by nlebedenco · Aug 21, 2018 at 03:02 AM
I know this is an old thread but for whoever ends up here, the source of the confusion is that Unity applies the tooltip to the label in EditorGUI.BeginProperty. So all you have to do is:
label = EditorGUI.BeginProperty(position, label, property);
This indeed works. This function reads the tooltip from the property attribute under the hood.
Wow an answer after so much time, didn't expect that :D. Thank you very much.
Answer by jvo3dc · Aug 31, 2017 at 04:51 PM
I don't have an answer I'm afraid, but I stumbled on the same thing in Unity 5.3.4p6. Both property.tooltip and label.tooltip are an empty string.
Edit: Same thing in 5.6.3f1. I thought for a moment that the custom drawer simply had preference over the attribute, but that does not seem to be the case.
According to the source of TooltipAttribute, the correct place to look for the tooltip is the label. But, it is indeed empty.
Your answer
![](https://koobas.hobune.stream/wayback/20220612111958im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Illuminating a 3D object's edges OnMouseOver (script in c#)? 1 Answer
On Mouse Click Button event 0 Answers