Hello ! I have a strange problem.
I have a Basic GUI :
And i use "OnPlayerInit" for display this. But i have a ChatCommand for display Again this GUI and when i try, i have this strange error :Code:[ { ""name"": ""XxxxxXXX"", ""parent"": ""XXX/Xxxxxxx"", ""components"": [ { ""xxxx"":""XxxxxXxxxxx.XX.XxxXxxxx"", ""xxxxxxxxx"": ""Xxxxx"", ""xxx"": ""xxxxxx.xxxx"", }, { ""xxxx"":""XxxxXxxxxxxxx"", ""xxxxxxxxx"": ""xxx xxx"", ""xxxxxxxxx"": ""xxx xxx"" }, { ""xxxx"":""XxxxxXxxxxx"" } ] }, { ""name"": ""ButtonAgree-7214194"", ""parent"": ""XxxxxXXX"", ""components"": [ { ""type"":""UnityEngine.UI.Button"", ""xxxxx"":""XxxxxXXX"", ""xxxxx"": ""x.x x.x x.x x.x"", ""xxxxxxxxx"": ""Xxxxx"" }, { ""xxxx"":""XxxxXxxxxxxxx"", ""xxxxxxxxx"": ""xxx xxx"", ""xxxxxxxxx"": ""xxx xxx"" } ] }, { ""parent"": ""ButtonAgree-7214194"", ""components"": [ { ""xxxx"": ""UnityEngine.UI.Text"", ""text"": ""Accepter"", ""xxxxXxxx"": xx, ""xxxxx"": ""XxxxxxXxxxxx"" } ] } ]
Anyone know why?? It's work with "OnPlayerInit" but not with ChatCommand...
Solved GUI 'Unknown parent' error
Discussion in 'Rust Development' started by UnderFawkes, Nov 9, 2015.
-
Afaik there is a bug which happens with buttons with text etc. That you can only have its name once. Once you initialized an UI with that name twice its nit going to work. You wikk need to add a Random String to the name.
-
-
Wulf Community Admin
The problem is that you're trying to add to a parent that doesn't exist. Unless you change the name of a GUI element, it uses a random ID, so you'd either need to store those IDs and grab them, or change the name of the element to something static.
-
[DOUBLEPOST=1447252484,1447189684][/DOUBLEPOST] -
[DOUBLEPOST=1447253548][/DOUBLEPOST] -
Wulf Community Admin
-
Thanks for Reply @LaserHydra and @Wulf