Does VisualElmenet.tooltip work at runtime?

I made a minimal example for testing at runtime. The button does change visually when clicked so the mouse is detected but no tooltip pops up. Am I missing some code? Any suggestions?

void Start() {
        var uiDoc= GetComponent<UIDocument>();
        var rootVE = uiDoc.rootVisualElement;
       
        var ve2 = new Button();
       
        ve2.style.width = 200;
        ve2.style.height = 200;
        ve2.style.backgroundColor = Color.black;
 
        ve2.tooltip = "A toolTip";
       
        rootVE.Add(ve2);   
    }

Tooltips are only supported in the Editor at this time. You’ll need a custom tooltip solution for runtime.
You can check this other thread about the same subject: Tooltips in UI Toolkit

1 Like

Thank for the answer & link.