How do I make a 3D ScreenGUI?

Hi I am having some severe trouble with replicated a ScreenGUI but in 3D Space, I know I would have to use a ScreenGui that will follow the camera and scale and move with the screen but I just dont know any of the math behind it, any help would be good!

Every solution that I have tried does not work when screens are smaller or bigger than mine or have a higher FOV

Here is a example from a game I like that does what I want to achieve:

5 Likes

These are client sided parts with surface GUIs on it.
You can create surfaceGuis on them and then but them into the StarterGUI

And set the adorne to the part:

2 Likes

Do you know how to make the part follow the camera and rescale with screen size and FOV because I already knew the SurfaceGui part but how would I make it behave like a actual 2D UI with 3d properties thanks for the help but I need some more if u can offer it

You can make it client sided and make a while true script that changes the Vector3 pos

the thing is I tried that but it just never fits the screen right and changes in scale, i even tried doing my own math to make it try fit but it just never does so i dont know what to do

did you find a solution? i have the exact same problem i need the ui to stay on my screen even with fov

move the part position relative to the camera facing the camera and then tweak the offset until it looks right

local testPart = Instance.new("Part")
local rs = game:GetService("RunService")

local camera = game.Workspace.CurrentCamera

rs.Stepped:Connect(function()
  local newPos = camera.CFrame.Position + camera.CFrame.LookVector*3 -- add offset relative to lookvector
  testPart.CFrame = CFrame.lookAt(newPos, camera.CFrame.Position)
end)
1 Like