TextLabel does not update

I am updating a TextLabel from a LocalScript and the TextLabel is always one update behind on the “updating” part

When I change the text property of the Label using a script, it updates once, then halts, and from then on it is always one update behind on rendering of the Text. According to the script and my Properties window, the label is at the scripts set value. But the Label refuses to render untill I wait and change the text again.

Demonstration:

What I have tried:

Reinstalling studio
Tested on another device
Tested on the roblox website
Imported the project to another Studio Project

Neither of the above works

Tell me if you need anything more or if everything works alright for you!

Isolated place file:
Placefile.rbxl (49.1 KB)

8 Likes

Do you have a cool-down for it to update? If not, try that.

?

There should be absolutely no cooldown between the TextLabel.Text and the rendered text. This is a bug.

2 Likes

Oh, ignore then. I thought a cool-down was needed

Thanks for the report! We’ll follow up when we have an update for you.

1 Like

I ran into this today and thought I was losing my mind.

In an additional wrinkle, I found that the text would update if I moused over it, oddly enough.

I was able to find a workaround in my situation, though: I was originally updating the text in a RenderStepped connection, but switching it to Heartbeat fixed the issue. It’s fine in this case since it doesn’t need to be frame-perfect or anything, but it definitely threw me for a loop.

1 Like

I’m experiencing the same thing. The text value changed on the properties but on screen it doesn’t tally up. It will update once you select the text label on explorer or hover your mouse on the text label.

2 Likes

I was helping someone in #help-and-feedback:scripting-support who turned out to be experiencing this bug.

I was able to reproduce this on a blank baseplate in studio with the following code in a LocalScript:

-- This code goes in a LocalScript and needs no further setup.
local Players = game:GetService("Players")
local TweenService = game:GetService("TweenService")


local player = Players.LocalPlayer
local playerGui = player.PlayerGui


local screen = Instance.new("ScreenGui")

local textLabel = Instance.new("TextLabel")
textLabel.Text = "0"
textLabel.TextColor3 = Color3.new(1, 1, 1)
textLabel.TextScaled = true
textLabel.Size = UDim2.fromOffset(200, 50)
textLabel.BackgroundTransparency = 1
textLabel.Parent = screen

screen.Parent = playerGui


local targetValue = Instance.new("NumberValue")
local interpolValue = Instance.new("NumberValue")

targetValue.Changed:Connect(function()
	local tween = TweenService:Create(interpolValue, TweenInfo.new(2, Enum.EasingStyle.Exponential, Enum.EasingDirection.In), {Value = targetValue.Value})
	tween:Play()
	tween.Completed:Wait()
	task.wait(3)
	targetValue.Value *= -1
end)

interpolValue.Changed:Connect(function()
	-- Putting task.wait() or game:GetService("RunService").Heartbeat:Wait() here prevents the issue
	textLabel.Text = tostring(math.round(interpolValue.Value))
end)

targetValue.Value = 800

textlabel_bug
(Hovering over the TextLabel causes it to update and properly show the .Text property)

The issue no longer happens when deferred events are off (Workspace.SignalBehavior is set to Immediate).

A work around is waiting for heartbeat (either directly or with task.wait) before updating the .Text property.

12 Likes

Omg how has this not been fixed yet? I don’t wanna have to use immediate event handling if it’s gonna be phased out - there’s no way this little bug has stumped the studio team for 8 months.

3 Likes

This is still affecting my experience as a developer. I just spent a large amount of time debugging all of my code to find out that deferred events (a feature now default to new experiences) was the root cause.

1 Like

I have spent so many time trying to realize what’s wrong with my narraitor script. Now I know that it’s roblox bug :pensive:

1 Like

Hi, we recently turned on a fix for this, could you double check if the issue still exists for you? thanks

2 Likes

Oh thank god they might have finally done something about this, Its been causing issues for me forever now. Please let this fix work

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.