Hi all. I'm making a script for my gun so when I right click it changes the camera closer to the camera. It works great!, Until I walk around. The camera just stays in one place even though Its wielded to the gun. Anything helps, I attempted making it so it goes with the characters footsteps, also its saying it cant Index field "Character" and Nil value even though I clearly gave it the value. Here is the local script inside of the gun, "ZoomInCamera is the Camera part wielded to the gun:

--/Variables
local currentcamera = game.Workspace.CurrentCamera
local mouse = game.Players.LocalPlayer:GetMouse()
local tool = script.Parent.Parent.Parent["Delino 21A"]
local player = game:GetService("Players").LocalPlayer
local playerposition = player.Character.HumanoidRootPart.Position
local cameraposition = playerposition
local camera = script.Parent.Parent.ZoomInCamera
local runService = game:GetService("RunService")
--
	mouse.Button2Down:Connect(function()
tool.Equipped:connect(function()
currentcamera.CameraType = Enum.CameraType.Scriptable
currentcamera.CameraSubject = script.Parent.Parent.ZoomInCamera
currentcamera.CFrame = currentcamera.CFrame
currentcamera.CFrame = script.Parent.Parent.ZoomInCamera.CFrame
camera.CoordinateFrame = CFrame.new(cameraposition, playerposition)


	mouse.Button2Up:Connect(function()
tool.Equipped:connect(function()
currentcamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
currentcamera.CameraType = Enum.CameraType.Custom
	
	tool.Unequipped:Connect(function()
currentcamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
currentcamera.CameraType = Enum.CameraType.Custom
end)
end)
end)
end)
end)
runService:BindToRenderStep('Camera', Enum.RenderPriority.Camera.Value, onRenderStep)

Thanks.