Calculating CFrame Considering FieldOfView When Aiming Down Sights

I don’t know how to calculate the CFrame while considering the FieldOfView at the moment aiming down sights is completed.

When I run this script, it gives consistent results, but as shown in the pictures below, the sight only appears exactly at the center of the screen when the player’s camera FieldOfView is 70.
If the FieldOfView is smaller, the sight moves upward.

How can I make the grip’s C0 tween properly while considering the FieldOfView at the moment aiming down sights is completed (for example, 30)?
Below is the Aim Down Sight code I am currently using in my gun kit:

local ray = cws.camera:ScreenPointToRay(cws.mouse.X, cws.mouse.Y, 0)
local offset = ads.CFrame:ToObjectSpace(CFrame.new(ray.Origin, ray.Origin + ray.Direction)).Position

grip.C0 = cws.origin.grip_c0
cws.services.ts:Create(
	grip,
	TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut),
	{C0 = grip.C0 * (cws.weapon.info.ads_offset or CFrame.new(offset.X, offset.Y, offset.Z))}
):Play()

This is the first time I have encountered this type of problem. After sitting in front of the monitor and struggling for 4 and a half hours, I have barely managed to find the cause.
I would appreciate even a simple suggestion!

70 FieldOfView:

10 FieldOfView:

On an off chance have you tried viewport point to ray? Could be due to gui inset.

Otherwise it could be the function itself, ive seen a post somewhere that it generates a circular arc instead of a 2d plane.

It could also be the C0 formula as well.

A lot of things to test out, im curious but do not have the time at the moment.

I would also have to spend an hour myself to recreate your testing setup which I do not have.

1 Like