I have a GUI that covers exposing part of a scope. But the Top and bottom one is not working
https://gyazo.com/7ea2efae034f4307f5df4ea9213200a9
as you can see the top and bottom is not covered, but the right and left works fine.
local function update()
self.ScopeGui:WaitForChild("Right").Size = UDim2.new(0, self.ScopeGui.Main.AbsolutePosition.X, 1, 0)
self.ScopeGui:WaitForChild("Left").Size = UDim2.new(0, self.ScopeGui.Main.AbsolutePosition.X, 1, 0)
self.ScopeGui:WaitForChild("Top").Size = UDim2.new(1, 0, 0, self.ScopeGui.Main.AbsolutePosition.Y)
self.ScopeGui:WaitForChild("Bottom").Size = UDim2.new(1, 0, 0, self.ScopeGui.Main.AbsolutePosition.Y)
self.ScopeGui:WaitForChild("Right").Position = UDim2.new(1, -self.ScopeGui.Main.AbsolutePosition.X, 0, 0)
self.ScopeGui:WaitForChild("Left").Position = UDim2.new(0, 0, 0, 0)
self.ScopeGui:WaitForChild("Top").Position = UDim2.new(0, 0, 0, 0)
self.ScopeGui:WaitForChild("Bottom").Position = UDim2.new(0, 0, 1, -self.ScopeGui.Main.AbsolutePosition.Y)
end
The AbsolutePosition.Y is for some reason going into the negative when testing ingame, but in studio its a positive value.