Why does my Tween Script for TextLabels doesn't seem to work?

i wanted to make a simple loading script for my game, like the letters will appear from above and slowly will become visible

local Tween = game:GetService("TweenService")
local info = TweenInfo.new(0.8, 8)
local targetPosition = UDim2.new(0.34, 0, 0.349, 0)
local goal = {TextTransparency = 0}

local L = script.Parent.L
local O = script.Parent.O
local A = script.Parent.A
local D = script.Parent.D
local I = script.Parent.I
local N = script.Parent.N
local G = script.Parent.G

-- // tweens

local LAppear = Tween:Create(L, info, {Position = targetPosition})
local LVisible = Tween:Create(L, info, goal)
wait(2)
LVisible:Play() -- it doesnt appear
LAppear:Play()
local Tween = game:GetService("TweenService")
local info = TweenInfo.new(0.8)
local goal = {}
goal.Transparency = 0
goal.Position = UDim2.new(0.34, 0, 0.349, 0)

local L = script.Parent.L
local O = script.Parent.O
local A = script.Parent.A
local D = script.Parent.D
local I = script.Parent.I
local N = script.Parent.N
local G = script.Parent.G

-- // tweens

local LAppear = Tween:Create(L, info, goal)
wait(2)
LAppear:Play()

It looks like you are trying to make the text label L appear and become visible by using two separate tweens. The first tween, LAppear , animates the position of the L label to the targetPosition . The second tween, LVisible , animates the TextTransparency property of L to 0.

One issue with your code is that you have a wait(2) statement before playing the LVisible tween. This means that the LVisible tween will not start until 2 seconds after the script is run. You might want to remove this wait statement, or adjust the duration of the tweens so that they are played in the order you expect.

Another issue could be that the TextTransparency property of the L label is not being set to 0 when the LVisible tween is played. One way to debug this issue is to check the current value of the TextTransparency property before and after the LVisible tween is played. You can do this by printing the value of L.TextTransparency to the output.

Here is an example of how you can modify your code to better understand what is happening:

local Tween = game:GetService("TweenService")
local info = TweenInfo.new(0.8, 8)
local targetPosition = UDim2.new(0.34, 0, 0.349, 0)
local goal = {TextTransparency = 0}

local L = script.Parent.L
local O = script.Parent.O
local A = script.Parent.A
local D = script.Parent.D
local I = script.Parent.I
local N = script.Parent.N
local G = script.Parent.G

-- // tweens

local LAppear = Tween:Create(L, info, {Position = targetPosition})
local LVisible = Tween:Create(L, info, goal)

print("Before playing LVisible tween:", L.TextTransparency)
LVisible:Play()
print("After playing LVisible tween:", L.TextTransparency)
LAppear:Play()

This modified version of your code will print the value of L.TextTransparency before and after the LVisible tween is played. This will allow you to see if the TextTransparency property is being set to 0 as expected.

Please stop using ChatGPT to answer people’s questions, it’s kind of annoying…

2 Likes

It’s not recommended to run two tweens at the same time. It’s better to collect both of them into a single tween, or run them one after another. The former is probably the easiest way to do this. However, I suck at Tweens, but I do remember that you can definitely interpolate two different properties in a single tween. Check out this page for more info: Tween | Roblox Creator Documentation

why you assuming I’m using it I didn’t say anything.

your comment is off-topic some annoying that

please stay on topic

I didn’t come here to argue I came here to help I’m going to delete the comment in 2 minutes because I don’t want to get a warning for being off topic

ChatGPT hasn’t solved any of the problems that you have responded to, and may even confuse the OP. Please stop.

You didn’t come here to help, ChatGPT did.

How does any of his posts even resemble something like ChatGPT…?
Please stay on topic. If you feel like his posts are off-topic, you are free to report them.

that’s what I’m saying he talked about the first I’m just responding

I’m interested to know if the update fixes this issue. Could you please let me know when it has been resolved?

I’ve used ChatGPT to solve my scripting problems when it was something small that I didn’t need to post on the DevForum (it would waste people’s times). I learnt a few things

  • it doesn’t really help
  • can end up confusing you
  • it looks EXACTLY like what @esadams188 has responded. ChatGPT responds with key phrases such as “Here is an example of”, “One issue with your code”, “It looks like you are”, and guess what? Those phrases are found in this guy’s post.
    It’s not just this post, its many others. I’ve already offered my solution to this, but I have yet to know if it works.
    Also, you openly admitted you were using ChatGPT:
    image
1 Like

I understand that ChatGPT is interesting, but let’s try to stay on track and continue discussing Why does my Tween Script for TextLabels doesn’t seem to work?

I keep getting a reply about you being off-topic. So this is my last reply to you, and I never said that I am using it but you keep bring it up. Even though we wasn’t talking about it.

Try and take a look here: UI Animations | Roblox Creator Documentation

wait(0.2)
local OAppear = Tween:Create(O, info, {Position = targetPosition})
local OVisible = Tween:Create(O, info, goal)
OAppear:Play()
wait(2)
OVisible:Play()

wait(0.2)
local AAppear = Tween:Create(A, info, {Position = targetPosition})
local AVisible = Tween:Create(A, info, goal)
AAppear:Play()
wait(2)
AVisible:Play()

wait(0.2)
local DAppear = Tween:Create(D, info, {Position = targetPosition})
local DVisible = Tween:Create(D, info, goal)
DAppear:Play()
wait(2)
DVisible:Play()

wait(0.2)
local IAppear = Tween:Create(I, info, {Position = targetPosition})
local IVisible = Tween:Create(I, info, goal)
IAppear:Play()
wait(2)
IVisible:Play()

wait(0.2)
local NAppear = Tween:Create(N, info, {Position = targetPosition})
local NVisible = Tween:Create(N, info, goal)
NAppear:Play()
wait(2)
NVisible:Play()

wait(0.2)
local GAppear = Tween:Create(G, info, {Position = targetPosition})
local GVisible = Tween:Create(G, info, goal)
GAppear:Play()
wait(2)
GVisible:Play()

wait(3)
L.Visible = false
O.Visible = false
A.Visible = false
D.Visible = false
I.Visible = false
N.Visible = false
G.Visible = false
if you try it, it doesn’t appear

The text is not visible at all, and the tweening doesn’t work.

How can I do it so the text will appear like how i want it?

Thanks!

p.s. if i changed the targetPosition to U