None of my tweens are working

This is wearied because the scripts are all the ones I have used before!

Aim: Making a Loading Screen.
Problem: No tweens are working.

Scripts. (2)

loading bar script:

local LoadingBar = script.Parent.Parent.LoadingBar

wait(3)

LoadingBar:TweenSize()(
  UDim2.new(1,0,1,0),
  Enum.EasingDirection.In,
  Enum.EasingStyle.Linear,
  20
)

other script:

local loadingtextlablescript = script.Parent.Loading.LocalScript
local loadinglable = script.Parent.Loading
wait(25)
loadingtextlablescript:Destroy()
loadinglable.Text = "Done!"
wait(1)
script.Parent:TweenPosition(UDim2.new(0,0,-1.5,0))
script.Parent.Visible = false

Is this a script error or a Roblox bug?

You aren’t tweening the size properly. You were calling nil since the TweenSize function returns nil.

Try this:

LoadingBar:TweenSize(
  UDim2.new(1,0,1,0),
  Enum.EasingDirection.In,
  Enum.EasingStyle.Linear,
  20
)

Ok thanks, really helpful. 1 other thing

any ideas why that doesn’t work?

Hmm. I don’t use the integrated UI tweening functions but everything looks right to me. Any output errors?

On a sidenote, if I were you, I would switch over to using TweenService for handling your tweens as it gives more room for customizability and it opens up the option to tween things for more than just UI elements (eg. CFrames, Vector3’s, colours, etc…).

1 Like