Hey developers,
I would like to know the best way to go about constantly keeping a Vector3 on my screen. I’m not too sure how to elegantly achieve this and have tried a myriad of things, one being a solution where I try to respect the ROBLOX camera rules and force the camera to look straight at the point (meaning the player head is literally centered on it).
Basically, I am wondering if it’s possible to find a minimum CFrame.Angles rotation to apply to the camera’s CFrame to keep the point on the screen (accounting for the GUI inset). It would also be nice if it could be offset by a certain X, Y so it wasn’t always sitting on the edge of the viewport.
Sorry if I have been vague, I’m just not too sure how to achieve this at all. I know for a fact that workspace.CurrentCamera:WorldToScreenPoint(Vector3 point) will return an x, y position of where the point is relative to the top left of the screen (accounting for GUI inset) alongside a boolean letting us know whether it’s on or off the screen. It may also be useful to know that when the point is off the screen, the x, y coordinates will be negative with respect to what plane it is out of bounds in.
As always, any help is appreciated!