How can I imitate a BillboardGui to use in a ViewportFrame?

Hey there!

I’m Currently trying to get a BillboardGui working in a ViewportFrame. I’m well aware that you can’t display one directly inside of a ViewportFrame, but I’m trying to imitate it so that it appears to be one. Here’s a list of things I’ve tried without success:

Getting the UI position of the object using Camera:WorldToViewportFrame(part.Position)

Placing a new part the same distance in front of the workspace camera as the part is in front of the viewport camera, and then using the same function as before on it to try and get a UI position.

Any help and ideas are appreciated. Thanks!

1 Like

Nevermind, found the solution. And since I get ridiculously triggered whenever someone says that they’ve found the solution and doesn’t tell us how, here’s the code:

local pos = camera:WorldToViewportPoint(model.Head.Position)
local UIPos = UDim2.fromScale(pos.X, pos.Y) 
objectView.TestFrame.Position = UIPos

camera is the viewport’s camera object, and TestFrame is the frame I placed inside of the ViewportFrame.

7 Likes