I wanted to make a little BGUI when you hover over an object but I have no clue how to make the grey part appear above the UI while everything else is below it, and I was wondering if anyone can point me in the right direction or give any ideas ? thanks !
Heres the image, I want the BGUI to be ontop of every object apart from the grey block
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local camera = workspace.CurrentCamera
local BILLBOARDGUI : BillboardGui = PATH
local GREY_BLOCK : Part = PATH
local connection = nil
local params = RaycastParams.new()
params.FilterType = Enum.RaycastFilterType.Exclude
params.FilterDescendantsInstances = {player.Character}
connection = RunService.Heartbeat:Connect(function(deltaTime)
local unitRay = camera:ScreenPointToRay(mouse.X, mouse.Y, 1)
local result = workspace:Raycast(unitRay.Origin, unitRay.Direction * 1000, params)
if result then
if result.Instance == GREY_BLOCK then
BILLBOARDGUI.AlwaysOnTop = false
else
BILLBOARDGUI.AlwaysOnTop = true
end
end
end)