LayoutOrder not updating quickly

I am not entirely sure if this is the right category, but it seemed to be more of a scripting issue.

I am trying to make a dialogue system. The problem I am having, is the layout order updates too slowly. Basically, when the new responses are added, they don’t go into layout instantly so the player can quickly see it move around.

						local Responce = ScrollerFrame.EX:Clone()
						Responce.LayoutOrder = index
						Responce.Parent = ScrollerFrame
						Responce.Name = "Responce".. index
						Responce.Visible = true
						Responce.Text = v.Value

There is also a button that is added before this that lets the player leave the dialogue.

try setting the parent and visibility of the frame last.

local Responce = ScrollerFrame.EX:Clone()
Responce.Parent = ScrollerFrame
Responce.Visible = true
Responce.Text = v.Value
Responce.LayoutOrder = index
Responce.Name = "Responce".. index

also I see that you are using an i, v in pairs loop. Are you using wait() or task.wait() this could also be a deciding factor with how fast this is running. Also, are you using for i, v in pairs or for i, v in ipairs() and with this, is it a table or instances that you are running through.

if you are using for i, v in pairs for a table you can change this to for i, v in ipairs and it will run slightly faster

1 Like