I have two TextLabels and want to calculate the Middle between them. Since they are under a UIListLayout, I can’t access the Position of the TextLabel and have to use the AbsolutePosition instead. My goal is to put a frame between them.
I have tried various ways, but the frame always moves somewhere where it shouldn’t move.
local lastSurvivorLabel = LeaderboardPlayer:FindFirstChild(lowestSurvivor.."_Place").AbsolutePosition
local highestVictimLabel = LeaderboardPlayer:FindFirstChild((lowestSurvivor + 1).."_Place").AbsolutePosition
SurvivedLine.Position = UDim2.new(???)
Iirc you can’t change absolute coordinates. However you can get the absolute position of frames parent and subtract that from the target absolute position. Then you can set the value of the frames position to the calculated value by using Udim2.fromoffset or something.
True. He could also skip a number for the layout order for every entry to make it easier to code. (1 → 1, 2 → 3, 3 → 5 etc. and then have the “bar” located at each layout order + 1)
I figured out how to do it. I created a new UIListLayout because, as FartFella mentioned, it scales the frame down.
Then I added several PlaceHolders with starting numbers 1 - 9 and changed the sort order of the UIListLayout to Name.
The script now changes the name of SurvivorLine to Number of last survivor + 1 and a 0 after the number. This puts the frame directly after the name of the last survivor.