✓ Accepted answer
ScreenPointToRay lets you, for example, determine where the player is pointing in the workspace given their mouse coordinates; that is, it'll give you a ray which you can use to raycast to see what the player's mouse is resting on (if anything).
Raycasting is probably too inefficient for your radar. It's probably better is to go through all objects you're thinking of displaying on the radar and determining their position on the radar based on the camera's current .CoordinateFrame (possibly based on the .CoordinateFrame.lookVector)
If you have the position of a model or part, you can use:
relativePos = workspace.CurrentCamera.CoordinateFrame:pointToObjectSpace(pos)
Now, if 'pos' is straight ahead 5 studs relative to the camera, relativePos will be equal to Vector3.new(0, 0, -5).
1 comment
Thanks bro!