Padding a new instance

When creating a new instance, how would one go about repositioning a new instance. For example

local name = Instance.new("TextLabel")

When creating a new textlabel instance, how would I make this new instance position below the next one?

That it is a descendant of something?
It may be so:

local name = Instance.new("TextLabel",Parent)

Or this way:

local name = Instance.new("TextLabel")
name.Parent = Parent

The last option can be used when you add more things or want to wait a few seconds.

I mean in this case, it is creating playerlabels in the same spot I want each one to be below each other. My question is whether lua has a component I could use to happen

1 Like

Well, copying the CFrame of an object.

local Clone -- Object clone
local Original -- Original object
local CF = Original.CFrame * CFrame.new(0,2,0)
Clone:SetPrimaryPartCFrame(CF)

If you trying to make a list inside a frame try looking at UIListLayout | Roblox Creator Documentation.

3 Likes

Best bet is to create a frame for these TextLabels to be put into, and have a UIGridLayout within the frame.

Edit: I just saws @flkfv’s coment. His method of a UIListLayout is better and easier if you want a straight list down a line. If you want rows and columns then do a UIGridLayout.

3 Likes