GUI script can't find children to tell them to become Visible?
A continuation of my problem from here.
I need my MakeVisible script from before (see link above) to make my GUI visible. It does make its parent GUI Visible, however, the Children of the GUI I also need to be visible aren't becoming so.
Here are the Children I need to make Visible (Close, Next, Previous, and Cover):
https://i.imgur.com/ksLXqZh.png
Below is my MakeVisible script that should be making these Visible. This is being triggered via a RemoteEvent. If you want to see those scripts, see the link to my other problem above.
01 | local ReplicatedStorage = game:GetService( "ReplicatedStorage" ) |
03 | local remoteEvent = ReplicatedStorage:WaitForChild( "DinosaurBook" ) |
05 | local GUI = script.Parent |
07 | local cover = GUI.Cover |
09 | local closebutton = GUI.Close |
11 | local nextbutton = GUI.Next |
13 | local previousbutton = GUI.Previous |
15 | local function onNotifyPlayer() |
18 | closebutton.Visible = = true |
19 | nextbutton.Visible = = true |
20 | previousbutton.Visible = = true |
23 | remoteEvent.OnClientEvent:Connect(onNotifyPlayer) |
I also tried a WaitForChild, however this didn't work.
Note that my PlayerGui is Enabled: https://i.imgur.com/Uimz9vV.png
And the Frame is Visible after the ClickDetector registers the click: https://i.imgur.com/dfa3xJ4.png
But the Close button (for example- Next, Previous, and Cover also do not become Visible) is not Visible: https://i.imgur.com/YzVDzWE.png
I imagine there's something wrong in my script that it can't find the GUI's Children, but it can find the GUI itself?