I’m confused about where to start and the docs didn’t help me at all
How would I use worldtoscreenpoint and world to viewpoint?
1 answer
WorldToScreenPoint is used like so...
local camera = workspace.CurrentCamera
local worldPosition = Vector3.new(0,10,0)
local vector, isOnScreen = camera:WorldToScreenPoint(worldPosition)
-- vector is the location of the world position, but in terms of the player's screen.
-- isOnScreen is a true/false value telling you if the worldPosition is in the view of the player's camera
Uses for this would be for if you had an interactable object in the world, you could cast that object's position to the player's screen and display a UI overtop of the object perhaps telling the player to press 'E'. This is similar to the new ProximityPrompt.
WorldToViewPoint is the exact same thing except for the fact that the 'vector' variable you get back will ignore the GUI Inset aka the topbar. This means that your UI can be under the topbar if the worldPoint is near the top of the player's camera view. WorldToScreenPoint will not ignore the GUI Inset, meaning if the worldPoint is under the topbar, the 'vector' variable will account for this and move downwards.
If you don't understand these explanations it likely means you don't understand the smaller parts of it. If you don't understand 2D vectors vs 3D vectors, or if you don't understand vectors at all, start with learning those first.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
^^ Kudos, I didn't know what it was but this explained it perfectly