I have a container element that has a UI widget attached to it via the Object menu.
I am not able to access this widget through Lua, I cannot find it, no matter if I try it with a script asset or by name like this:
|local container = self:GetEntity():GetParent():GetParent()|
|Print(“consoleWidget by asset”,self.properties.screen,container:FindWidget(self.properties.screen,true))|
|Print(“consoleWidget by asset”,container:FindWidget(“consoleWidget”,true))|
[Server] consoleWidget by asset userdata: 0x7fe303ca3038 nil
[Server] consoleWidget by asset nil
I studied the API up and down and tried putting the script and the widget in the same container as to no extent. The provided widgets in the template examples are all children of user/player or game, but not of world. Could it be related to that? I need that widget in the world, though. And if so, that should be clearly mentioned in the API.