Aiming system for FPS/TPS weapons

I have made a weapon system that is made with the roblox tool, but instead of using the default roblox tool way of handling gripping I used Headstackks solution so I could animate it as well:

But now that I am finished with the basic functionality such as shooting and reloading I now need to make an aiming feature but I came to a problem on how I should do it, I can easily make it so I zoom in the camera and stuff, but I come to a problem with how should I make the gun readjust itself based on if you’re zoomed in or not, I came up with 2 solutions either readjust the C0 so it would look through the scope/iron sights accurate in the center of the screen (but I came to a road block cause once in first person the gun seemed to go up infinitely which might of been cause of the way I made my viewmodel) then I decided to instead use custom animations but that seemed like a lot of work.

Now I am unsure of what I should do for aiming, thanks in advance for any help you may give.

Viewmodel code:

--|| SERVICES ||--
local RunService = game:GetService("RunService")
local RepStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
--|| VARIBLES ||--
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Camera = workspace.CurrentCamera
local ViewModel = RepStorage.ViewModel:Clone()
local ViewModelRoot = ViewModel.PrimaryPart

local BobbleValue =,0,0)
local RotationValue =,0,0)
--|| FUNCTIONS ||--
function UpdateViewModel()
	local HeadCFrame = Character.HumanoidRootPart.CFrame *,1.5,0)
	if (Camera.CFrame.Position - HeadCFrame.Position).Magnitude < 1 and Character:FindFirstChildOfClass("Tool") ~= nil then
		ViewModel.Parent = Camera
		ViewModel.Torso["Left Shoulder"].Transform = Character.Torso["Left Shoulder"].Transform
		ViewModel.Torso["Right Shoulder"].Transform = Character.Torso["Right Shoulder"].Transform
		ViewModelRoot.CFrame = Camera.CFrame *, -1.5, -0.5) *,BobbleValue.Y,BobbleValue.Z) * CFrame.Angles(math.rad(RotationValue.X),math.rad(RotationValue.Y),math.rad(RotationValue.Z))
		Character.Torso.ToolGrip.Part0 = ViewModel.Torso
		ViewModel.Parent = nil
		Character.Torso.ToolGrip.Part0 = Character.Torso
function UpdateVisualEffect(dt)
	local Bobble =, 0, 0)
	local Rotation =, 0, 0)
	if Character.Humanoid.MoveDirection.Magnitude > 0 then
		local BobbleX = math.cos(tick() * math.pi * 2) * .2
		local BobbleY = math.abs(math.sin(tick() * math.pi * 2)) * .2
		local RootSpaceDirection = Character.HumanoidRootPart.Position + Character.Humanoid.MoveDirection
		RootSpaceDirection = Character.HumanoidRootPart.CFrame:ToObjectSpace(,RootSpaceDirection.Y,RootSpaceDirection.Z))
		local RotateZ = -RootSpaceDirection.Position.X*15
		Bobble =, -BobbleY, -RootSpaceDirection.Position.Z/2)
		Rotation =,0,RotateZ)
	BobbleValue = BobbleValue:Lerp(Bobble,dt*10)
	RotationValue = RotationValue:Lerp(Rotation,dt*10)
function RenderStepped(dt)

Aiming Code:

function OnAiming(dt)
	local HeadCFrame = Character:WaitForChild("HumanoidRootPart").CFrame *,1.5,0)
	local AimingCFrame = Tool:WaitForChild("AimPart").CFrame:ToObjectSpace(HeadCFrame)
	AimingCFrame = Character.Torso:WaitForChild("ToolGrip").C0 *,AimingCFrame.Position.Y,0)
	if not ActuallyEquipped or Reloading then
		Aiming = false
	if Aiming then
		AimLerp = math.clamp(AimLerp + (dt*(1/Settings.ZoomSpeed)),0,1)
		AimLerp = math.clamp(AimLerp - (dt*(1/Settings.ZoomSpeed)),0,1)
	Camera.FieldOfView = DefaultFOV/(1+((Settings.ZoomInAmount-1)*AimLerp))
	Character.Torso:WaitForChild("ToolGrip").C0 =,0.5,0):Lerp(AimingCFrame,AimLerp)