Scripts/Local Scripts not being able to interact with ui sometimes

I’m kinda new here, so I don’t know if this is really the right place to post this, please tell me if it is, but anyways, it seems that any script or local script that tries to interact with ui is not working at all.

I tried to mix messing with other services while modifiying ui but it didn’t work, I tried to use a script instead of a local script, it also didn’t work, also no error messages are appearing in the output, so I don’t know what could be causing this, also this seems to affect all games that I make.

I tried this code with a script inside startergui and it worked for some reason

game.Workspace.Baseplate.Color = Color3.new(1, 0, 0)

script.Parent.ScreenGui.Enabled = false

Fonts also seem to have disappeared from my inventory? I don’t know what’s up with that.

Sorry if I couldn’t provide enough information or the information is a bit inconsistent

A private message is associated with this bug report

1 Like

I’ve been having mysterious issues with UI all day today. I even started getting issues with the CoreGui having module requiring errors every time I do a local server test in Studio. Not sure what it is, but I’ve been getting the module recursion error even though the module in question doesn’t require any other module.

1 Like

I think there was a module error at some point for me aswell, but now nothing shows up and yet the ui doesn’t work still

1 Like

I’ve decided with my issues to give it a day or two and see if they sort themselves out on their own. If not, I’m in serious trouble. I just released the first demo for my game hours ago and have already been getting problems of my UI modules sometimes not requiring randomly when people join a server due to the recursive requiring error. I’m unable to track down the error due to having almost 0 success replicating the issue.

1 Like

Oof, that’s a problem, I hope it gets fixed soon

1 Like

local script should be used for gui and etc
it’s client-side script
they run on clients

while script is server-side script
they run on server

try this on local script (putting on StarterGui)

local s=script.Parent

local t=Instance.new("TextLabel")
t.Parent=s.ScreenGui
t.AnchorPoint=Vector2.new(0.5,0.5)
t.Size=UDim2.fromScale(0.25,0.25)
t.Text="Press or Hover"
t:GetPropertyChangedSignal("GuiState"):Connect(function()
if t.GuiState==Enum.GuiState.Press then t.Text="I'm being pressed" and t.TextColor3==Color3.fromRGB(74,70,57)
elseif t.GuiState==Enum.GuiState.Idle then t.Text="Just Chilling" and t.TextColor3==Color3.fromRGB(70,70,70)
elseif t.GuiState==Enum.GuiState.Hover then t.Text="I'm being hovered" and t.TextColor3==Color3.fromRGB(21,21,21)
end
end)
1 Like

I took a little while to reply because I was experimenting on why this worked and I think ui elements are only being scriptable for me if I create them using instance.new cuz I made a little test local script and it only worked with creating a new one rather than editing an existing one

Are you sure you’re accessing the correct Instances within Player.PlayerGui and not the static ones in StarterGui in your code?

1 Like

Ok so let me clarify some of your problems. Sometimes player can load before the game is loaded and that’s the reason things like those can happen, when working with UI’s you should consider using game.Loaded event or game:IsLoaded function, in 99% of UI’s or requiring errors will be fixed.

1 Like

Thank you for inquiring about this; likely this is not a Studio bug, especially that you’re seeing it on your deployed game. Maybe a DevForum community post is a better forum for this, it’s likely the community can help you debug the issue (as seen in the thread).

1 Like

Sorry, I forgot I made this and I don’t think this is the reason, I was infact using startergui, but it was working fine for quite some time until it was not (It might still be the reason, so I’ll test this out later)

I think there was already something doing this and it was still bugged

Oh, how do I change the category then?

I think it should go into Help and Feedback – not sure how to change the category though. Maybe you can open a new thread and link to this one?

2 Likes