I tried making a script repositioning the captures UI above the backpack UI and it never seemed to work no matter what I did with scale, offset etc.
I don’t think there’s a problem with the backpack module itself, it looks like guy was smart and always parented after setting properties. I did waitforchild etc
I’d be extremely grateful if someone wrote this script so I can lazily plug in and play. But seriously, I’d like to learn from it because I don’t understand right now.
However, I don’t really want something more complex than one script that I can copy and paste and put all my GUIs in. This leads me to a more philosophical question…
Is it actually possible to have a nice UI for all players?
Oh, what a lovely UI, with anchor point .5,.5, converted to scale, and with a UIAspectRatioConstraint. All the standard tips people give for a consistent sized UI. Now let’s see what was done in Roblox Studio to create this…
Try setting anchor point to (0.5, 1) and setting position at x(0.5, 0) y(1, -H), H being the height of the backpack.
No scripts needed.
You could also parent them to the same frame and position the frame with anchor point (0.5, 1) and position x(0.5, 0) y(1, 0), this is what i did to keep my hotbar config above my hotbar.
Oooh, so the backpack is created via script too ? Anyway, do u have control over what’s gonna be the backpack’s parent ?
If so I believe my second suggestion is the more consistent one.
Sorry for not catching that on ur post ! It should work if you change the anchor points from (0.5, 0.5) to (0.5, 1) tho.
Well that would just be a matter of keeping track of who is the highest and add to the DisplayOrder.
--LocalScript in StarterPlayerScripts
local Players = game:GetService("Players")
local PlayerGui = Players.LocalPlayer:WaitForChild("PlayerGui")
local function updateDisplayOrder()
local maxY = 0
local topUI
for _, gui in ipairs(PlayerGui:GetChildren()) do
if gui:IsA("GuiObject") then
local y = gui.AbsolutePosition.Y + gui.AbsoluteSize.Y
if y > maxY then
maxY = y
topUI = gui
end
end
end
if topUI then
for _, gui in ipairs(PlayerGui:GetChildren()) do
if gui:IsA("GuiObject") and gui ~= topUI then
gui.DisplayOrder = 0
end
end
topUI.DisplayOrder = 1
end
end
updateDisplayOrder()
PlayerGui.ChildAdded:Connect(updateDisplayOrder)
PlayerGui.ChildRemoved:Connect(updateDisplayOrder)
This may help.. Didn’t test it however.
As far as your GUI looking good on all screens, that is shockingly easier than it seems. In the position you have {0, 0}, {0, 0} .. the first number is the key. That is scale, while the second is offset. If you line it up using scale, it will stay in the same relative position on any screen.