I want to make the UI move for the popping out element.
Issue is clear in the video:
Have not found any solutions because I do not know what to look for
local viewport = script.Parent
local button_info = viewport:WaitForChild("infoButton")
local info_slider = viewport:WaitForChild("InfoSlider")
local UIListLayout = nil
local startingPadding = UDim.new(0,0)
if viewport.Parent:IsA("ScrollingFrame") then
UIListLayout = viewport.Parent:FindFirstChildOfClass("UIListLayout")
startingPadding = UIListLayout.Padding
end
button_info.MouseButton1Click:Connect(function()
if info_slider.Position.X.Scale == 0 then
info_slider:TweenPosition(UDim2.fromScale(0.946,0), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, 0.5, true)
if UIListLayout then
local info = TweenInfo.new(0.5, Enum.EasingStyle.Sine,Enum.EasingDirection.InOut)
local props = {}
props.Padding = UDim.new(startingPadding.Scale,viewport.AbsoluteSize.X)
game:GetService("TweenService"):Create(UIListLayout, info, props):Play()
end
else
info_slider:TweenPosition(UDim2.fromScale(0,0), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, 0.5, true)
if UIListLayout then
local info = TweenInfo.new(0.5, Enum.EasingStyle.Sine,Enum.EasingDirection.InOut)
local props = {}
props.Padding = UDim.new(startingPadding.Scale,0)
game:GetService("TweenService"):Create(UIListLayout, info, props):Play()
end
end
end)
yes just make sure to use offset and not scale to size up and position the viewportframe (and the frame that holds the info) or else it will just expand with the frame when it tweens