How to make this Billboard GUI appear ontop of everything apart from one part?

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

2 Likes

Well is the hovering mechanic based on where you camera is relative to the object, or where you mouse is relative to the object

2 Likes

I’m using a ClickDetector to tell if the mouse is over the part

2 Likes

Dont use a click detector, why dont have a loop that checks if the mouse is over a specific object whether that be through raycasting or Mouse.Target

2 Likes
  • Sorry, misread the post. 30…
2 Likes

quick thing i wrote up @Mrtrainhead3617

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)

@Mrtrainhead3617

2 Likes

thanks, I’ll give it a try in a minute