Problem encountering when using TopBarPlus

  1. What is the issue?
    When I click the icon that I have created using TopBarPlus, the UI will tween to the position. I realised that everytime I click the button, it takes around 3-4 seconds (or require multiple click) to tween back to the original position that I have set. How do I resolve this issue?

A response would be highly appreciated. Thank you.

This is my code:

local framegui = game.Players.LocalPlayer.PlayerGui:WaitForChild("FrameGui")
local frame = framegui:WaitForChild("MainFrame")

local framemain = TopBarMod.new()
framemain:bindEvent("selected", function()
	frame:TweenPosition(UDim2.new(0.5, 0, 0.5, 0))
end)
framemain:bindEvent("deselected", function()
	frame:TweenPosition(UDim2.new(0.5, 0, -0.5, 0))
end)
1 Like

TweenPosition and TweenSize have “override” parameter, and it disabled by default, so that’s why you cant cancel current tween. You need to do like:
frame:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), nil, nil, 1, true).

nil is EasingDirection and EasingStyle, 1 is tweening time. Replace it as you want.

2 Likes

Oh that’s why! Thank you so much!

1 Like

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