StarterGui scripts unable to read ObjectValues on default client

This bug started appearing yesterday at around the same time of the site outage. We assumed the bug would be fixed when the outage was but the issue is still persisting.

Currently our game UI scripts are not properly working on the default Roblox Client but when played using the Microsoft Windows Store version of Roblox the game loads fine.

When checking the scripts they seem to be running without error but when they need to read a ObjectValue’s value on the default client is always nil even when in studio it’s assigned a value.

Repro place: Neo UI Bug - Roblox

Could you make a small repro file of just this? Could you also fix the title of your thread to refer to the actual issue? (Currently way too broad)

3 Likes

Sure thing. I updated the title but currently do not have access to a computer and may take a few hours to create a repro.

Close resemblance to this topic:

Also possibly the existing bug on how to recreate it:

I’ve uploaded the UI code that is conflicting on different Roblox versions on a uncopylocked place so that you can test and download it. You will notice that on the Windows Store client the menu will load fine like this.
image
While on the default Roblox client the buttons are all red.
image
The script does this when the ObjectValue does not have a assigned value. There is only 1 script inside and I’ve stripped away majority of the code to only the part causing the problem. I hope this helps in fixing the issue.

Has any work been done on this?

As the owner of the game that Crimson_Foxx posted above, this is costing us every hour that this unfortunate bug persists.

I do hope something is being done.

This was in Engine Features rather than Engine Bugs. I moved it over now for better visibility.

Also, since it is the weekend now, I wouldn’t expect a response from engineering until (at the earliest) Monday.

3 Likes

I believe this bug is caused by the Default client being a bit faster than the Windows store client, as simply adding a wait(1) at the top fixes the problem.

However

Not using an ObjectValue and instead checking to see if there’s a Frame that shares it’s name with a Button works as well and I recommend doing that instead. :slight_smile:

This is a bug that still needs to be fixed on Roblox’s end, however.

Here’s the code that works on the Default client:


local Root = script.Parent
local TweenService = game:GetService("TweenService")
local Player = game.Players.LocalPlayer
local Children = Root.Menu.Options:GetChildren()


for i=1, #Children do
	if Children[i]:IsA("Frame") then
		Children[i].Button.MouseEnter:connect(function()
			TweenService:Create(Children[i].Effect, TweenInfo.new(.75, Enum.EasingStyle.Quad), {Size = UDim2.new(1, 0, 1, 0)}):Play()
			
			TweenService:Create(Root.Menu.Selector, TweenInfo.new(.5, Enum.EasingStyle.Quad), {Position = UDim2.new(0, 0, 0, Children[i].AbsolutePosition.Y - Root.Menu.AbsolutePosition.Y)}):Play()
		end)
			
		Children[i].Button.MouseLeave:connect(function()
			TweenService:Create(Children[i].Effect, TweenInfo.new(.5, Enum.EasingStyle.Quad), {Size = UDim2.new(0, 0, 1, 0)}):Play()
		end)
		
		if Root.Parent:FindFirstChild(Children[i].Name) then
			Children[i].Button.MouseButton1Click:connect(function()
				Root.Visible = false
				Children[i].AssociatedGui.Value.Visible = true
				Player.PlayerGui.ClientGui.Leaderboard.Visible = false
				if Children[i].AssociatedGui.Value.Name == "FreeFlight" then
					workspace.CurrentCamera.CameraType = "Track"
					workspace.CurrentCamera.CameraSubject = workspace.Display
				elseif Children[i].AssociatedGui.Value.Name == "ATC" then
					Player.PlayerGui.ClientGui.Leaderboard.Visible = true
				end
			end)
		else
			Children[i].BackgroundColor3 = Color3.fromRGB(240, 118, 118)
		end
	end
end

We managed to fix the issue days ago accidentally with a debug loop that most likely delayed the code for just long enough.

2 Likes

Alright, Crimson_Foxx!

Not sure why the Store version is delayed a bit by default.

I would assume this was a unintentional change as it broke quite a few games from what I could tell. Also even when finding the frames only by the button’s names in our new version didn’t work without the loop so it seems UIObjects all load after scripts do not just a ObjectValue problem.