I’m trying to make a small chat program that uses an UIList layout to order the messages. Each message i set the canvas position to 1e6 in the Y axis, but sometimes, it doesn’t seem to work and the message gets cut off and the last messages seem to have no padding, even when i have set the padding to 0.1 in the UIList layout. Ideas on how to fix this? (sorry about the category, not sure where else to put this)
(it’s scrolled to the maximum here)
Here’s the script
FilterText.OnClientEvent:Connect(function(messageInfo)
if messageInfo == false then
Cooldown.Visible = true
task.wait(0.9)
Cooldown.Visible = false
return
end
local Message = script:FindFirstChild("MessageTemplate"):Clone()
local MessageText = Message:FindFirstChild("Message")
local PlrIcon = Message.PlrIcon
PlrIcon.Image = messageInfo.Icon
MessageText.Text = string.format("<font transparency='0.5'><font size = '7'>%s</font></font> %s: %s",messageInfo.Time,messageInfo.Username,messageInfo.Message)
Message.LayoutOrder = #Texts:GetChildren() - 2
Message.Parent = Texts
if (#Texts:GetChildren() - 2) > Configs.MaxMessages then
local lastMessage,lowestOrder
for _, currentMessage in ipairs(Texts:GetChildren()) do
if currentMessage:IsA("Frame") then
if not lastMessage or currentMessage.LayoutOrder < lowestOrder then
lastMessage = currentMessage
lowestOrder = currentMessage.LayoutOrder
end
end
end
if lastMessage then
lastMessage:Destroy()
end
end
Texts.CanvasPosition = Vector2.new(0,1e6)
end)
UIListLayout’s properties: