I want to create a list, that updates automatically, based on its contents, however I can’t use UIListLayout as I can’t do tweening. So basically I add a new notification to the bottom, and I want all the ones above to tween up. However, that don’t happen at the moment
--// Create a notification prompt
local function CreateNotification(noticeType, notification)
coroutine.wrap(function()
if #Notices > 0 then -- More than 1 notice
local Count = 0
for i, v in pairs(Notices) do
Count += 1
local Notice = Frame:FindFirstChild(i)
if Notice then
Notice:TweenPosition(UDim2.new(0, 0, Count / 3, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.25, true)
end
end
end
-- Create the new prompt
local NewPrompt = Template:Clone()
Notices[NewPrompt] = 1
NewPrompt.Parent = Frame
-- Tween in
local TweenIn = TweenService:Create(
NewPrompt,
TweenInfo.new(0.5),
{AnchorPoint = Vector2.new(1, 0.5)}
)
TweenIn:Play()
wait(WaitTime)
-- Tween out
local TweenOut = TweenService:Create(
NewPrompt,
TweenInfo.new(0.5),
{AnchorPoint = Vector2.new(0, 0.5)}
)
TweenOut:Play()
TweenOut.Completed:Wait()
Notices[NewPrompt] = nil -- Remove from Notices table
NewPrompt:Destroy()
end)()
end