Tween not playing

I’ve been working on adding menu animations to my Backrooms game and for some reason the tween for opening the play menu won’t play. The menu opens’ but it doesn’t play the tween. Here’s the script:

-- UI
local Play = script.Parent
local PlayMenu = script.Parent.Parent.PlayMenu

-- Tweening
endPos = UDim2.new(0.304, 0, 0.058, 0)
startPos = UDim2.new(0.304, 0, 1.5, 0)
tweenService = game.TweenService
speed = TweenInfo.new(0.4)
local open = tweenService:Create(PlayMenu, speed, {Position = endPos})

Play.MouseButton1Click:Connect(function()
	PlayMenu.Position = endPos
	PlayMenu.Visible = true
	open:Play()
end)
PlayMenu.Position = endPos

you set the position before the tween played

What @DamSam127 said and you need to give it atleast an EasingStyle in your TweenInfo

-- Service
local TweenService = game:GetService("TweenService")

-- UI
local Play = script.Parent
local PlayMenu = script.Parent.Parent.PlayMenu

-- Tweening
StartPos = UDim2.new(0.304, 0, 1.5, 0)
EndPos = {Position = UDim2.new(0.304, 0, 0.058, 0)}
Speed = TweenInfo.new(0.4)

local Open = TweenService:Create(PlayMenu, Speed, EndPos)

Play.MouseButton1Click:Connect(function()
	PlayMenu.Position = StartPos
	PlayMenu.Visible = true
	Open:Play()
end)

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