What I want to achieve is to have the player’s camera align with a target in a way that the target appears at a certain screen position. E.g., I want it to be shown at {0.3, 0}, {0.5, 0}.
The issue I’m having is that I can’t figure out what calculations I’d need for this. I know it would need to account for the camera’s field of view and the distance to the target, but I just don’t know how I’d go about doing this.
I’ve tried using camera:ScreenPointToRay() but I didn’t get far with it. I’ve also tried searching the Creator Hub and other sites for solutions but I couldn’t find any.
If anyone could just push me in the right direction, that would be greatly appreciated.
Here’s how I currently position my camera:
-- Distance to point (All axis)
local offsetDistance = 80
-- In a loop
local finalCFrame = CFrame.lookAt(targetPosition + Vector3.new(1, 1, -1) * offsetDistance, targetPosition)
Picture examples:
- Current result:
- Desired result:



