Tween script error "Unable to cast double to token"

Hey! I’m working on a Loading Bar for my main menu but I’ve ran into a problem. After scripting the tween’s, it says “Unable to cast double to token” when I go to test it out.

Here’s the error:
Screenshot 2023-08-26 131634

Here’s the script:

local loadingBar = script.Parent
local tweenService = game:GetService("TweenService")
local img = loadingBar.Parent.ImageLabel

local mainFrame = loadingBar.Parent.Parent.Parent.MainMenu.MainFrame
local playBtn = mainFrame.PlayButton
local settingsBtn = mainFrame.SettingsButton
local creditsBtn = mainFrame.CreditsButton
local titleImg = mainFrame.Title

wait(3)
loadingBar:TweenSize(UDim2.new(0.041, 0,0.04, 0), 1)
wait(2)
loadingBar:TweenSize(UDim2.new(0.217, 0,0.04, 0), 3) -- line 14
wait(4)
loadingBar:TweenSize(UDim2.new(0.555, 0,0.04, 0), 1)
wait(3)
loadingBar:TweenSize(UDim2.new(0.728, 0,0.04, 0), 2)
wait(4)
if not game:IsLoaded() then
	game.Loaded:Wait()
else
	loadingBar:TweenSize(UDim2.new(0.908, 0,0.04, 0), 2)
	wait(3)
	loadingBar:TweenPosition(UDim2.new(0.058, 0,2, 0), 1)
	img:TweenPosition(UDim2.new(0.027, 0,2, 0), 1)
	wait(1)
	titleImg:TweenSize(UDim2.new(0, 751,0, 500), 1)
	titleImg:TweenPosition(UDim2.new(0.272, 0,-0.061, 0), 1)
	playBtn:TweenPosition(UDim2.new(0.5, 0,0.5, 0), 1)
	settingsBtn:TweenPosition(UDim2.new(0.5, 0,0.652, 0), 1)
	creditsBtn:TweenPosition(UDim2.new(0.5, 0,0.797, 0), 1)
end

Any help will do! Thanks!

The second argument for TweenSize is EasingDirection. You’ve passed 3, there’s no EasingDirection with that value

1 Like

seems like “3” isn’t a easingdirection, I searched it up and tried what 3 is equivalent to and it still gives the error, I think 3/quad isn’t a option for that type as far as I know.

1 Like

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