Tween instantly appearing instead of animating

Trying to animate a UI appearing when you click an imagebutton, and I’ve been stuck with the UI instantly appearing instead of actually tweening.


I have 2 scripts, one in the actual button that fires a bindableevent and the other in the frame of the UI that does the tweening.

local TweenService = game:GetService('TweenService')
local HomeTab = script.Parent.Parent.Parent.Parent.HomeTab
local LeaderboardsTab = script.Parent.Parent.Parent.Parent.LeaderboardsTab
local Play = script.Parent.Parent.Parent.Parent.Play
local TopBar = script.Parent.Parent.Parent


script.Parent.MouseButton1Click:Connect(function()
	TopBar.Frame.HomeText.ImageColor3 = Color3.new(0.917647, 0.933333, 0.698039)
	TopBar.Frame.CollectionText.ImageColor3 = Color3.new(1, 1, 1)
	TopBar.Frame.EventsText.ImageColor3 = Color3.new(1, 1, 1)
	TopBar.Frame.LeaderText.ImageColor3 = Color3.new(1, 1, 1)
	TopBar.Frame.PlayText.ImageColor3 = Color3.new(1, 1, 1)
	TopBar.Frame.ShopText.ImageColor3 = Color3.new(1, 1, 1)
	TopBar.Frame.Parent.Frame.SocialText.ImageColor3 = Color3.new(1, 1, 1)
	HomeTab.HomeBG.Visible = true
	game.ReplicatedStorage.TweenEvent:Fire('HomeTween')
end)

and

local TweenService = game:GetService('TweenService')
local HomeTab = script.Parent
local LeaderboardsTab = script.Parent.Parent.Parent.LeaderboardsTab
local Play = script.Parent.Parent.Parent.Play
local TopBar = script.Parent.Parent.Parent.TopBar

local function HomeTween(t)
	if t == 'HomeTween' then
		script.Parent:TweenPosition(UDim2.new(0,0,0,0), Enum.EasingDirection.InOut, Enum.EasingStyle.Exponential, 1)
	end
end

game.ReplicatedStorage.TweenEvent.Event:Connect(HomeTween)

I’d appreciate it if you can help me fix this!

Try this code out and see what it prints out:

local TweenService = game:GetService('TweenService')
local HomeTab = script.Parent
local LeaderboardsTab = script.Parent.Parent.Parent.LeaderboardsTab
local Play = script.Parent.Parent.Parent.Play
local TopBar = script.Parent.Parent.Parent.TopBar

local function TweenCallbacked(state) -- would print out the `Enum.TweenStatus`
	warn("tween has been callbacked, state: " .. tostring(state))
end

local function HomeTween(t)
	if t == 'HomeTween' then
		script.Parent:TweenPosition(UDim2.new(0,0,0,0), Enum.EasingDirection.InOut, Enum.EasingStyle.Exponential, 1, false, TweenCallbacked)
	end
end

game.ReplicatedStorage.TweenEvent.Event:Connect(HomeTween)

Prints ‘tween has been callbacked, state: Enum.TweenStatus.Completed’, still instant with no animation though.

Okay, try setting the override: boolean of TweenPosition() to true. If it’s still instant, try setting the time: number to something other than 1.

Tried both, still instant for some reason.

Try adding a print inside HomeTween(), see how many times it prints.

This is tweening it shut as in it is going to the size of 0, this is not what is making it visible.
is this possibly whats making it visible? HomeTab.HomeBG.Visible = true

Added a print, it only prints once.

That makes it visible, the other line moves it. It’s originally at 0, 0, 1, 0.

sorry, i thought it was size even thought it says “tweenposition” my bad. Are you positive its not at that position already??

Yep, I watched the properties of the frame when the tween started, it jumps from 0, 0, 1, 0 to 0, 0, 0, 0 instantly.

Well I looked over your script and nothing else is changing the position so it must be something else effecting it. Could this be the case?

Those are the only 2 scripts in the game and I haven’t added anything else to the scripts so it shouldn’t be affected by anything else I don’t think.

Could you share screenshots to show us what the workspace looks like and the properties?



Fixed, used Boatbomber’s boattween instead, seems like Roblox’s tweening is broken.