How do I make the Screen Gui behave like a Billboard Gui?

So I was wondering how can I make the Screen Gui appear to have the same size (similar to how Billboard Gui works when you set the X and Y scale). Although, I do not know how to make it but I managed to create a script which sets the Screen Gui’s to a certain part’s position.

local Cam = game.Workspace.Camera
local Gui = script.Parent
local Frame = Gui.PressButton
local Part = game.Workspace.Thing
local RS = game:GetService("RunService")

RS:BindToRenderStep("IconUpdate",Enum.RenderPriority.Last.Value,function()
	local PartPos = Cam:WorldToScreenPoint(Part.Position)
	Frame.Position = UDim2.new( 0 , PartPos.X , 0 , PartPos.Y )
end)

Here is the Screen Gui far away

and here is the Screen Gui up close

Long story short, I want to make the Screen Gui behave like a Billboard Gui when it doesn’t expand and such.

1 Like

I would recommend playing around with comparisons between the part in question and the camera. You could try taking the position vector from both the part’s CFrame and the camera’s CFrame, grabbing the distance between them using .magnitude, and scaling your ScreenGui based on that. Let me know if this helps you out at all!

1 Like

You’d want to get the distance of the object to the camera and then do some math to get its size.
Also why aren’t you using a billboard gui?

1 Like

That’s not the point of a Screen Gui… If you want it to scale down, use a Billboard GUI.

2 Likes