Ray is not precise while using same script

Hello!!
So I’m making guns, but I have a trouble, so i’m using the SAME script for both, only edited a bit of the other one, but for some reason, this gun: https://gyazo.com/a04f0ec686ea0421db58f0659774f5b0

is more precise than this: https://gyazo.com/4d606f7ec69a3234a8c07f1ec119ee74

You can see how the ray in the Second is more down, I don’t know why

PRECISE GUN CODE:

 function Shot()
	if Ammo.Value > 0 and not realoding and canshot == true and Equipped then		
		--//Cast ray
		events.Effect:FireServer(tool.BulletSpawn.Effect, tool.BulletSpawn.aaaa, tool.BulletSpawn.aa, tool.Bolt)
		local ray = Ray.new(hole.CFrame.p, (mouse.hit.p - hole.CFrame.p).unit * range)
		local touch, position = workspace:FindPartOnRayWithIgnoreList(ray, {Character})
		
		--//Hit detection
        if touch then
	events.Hit:FireServer(touch, Damage) 
     print("fired")  
else
	print("nil")
end
		--//Trace
			--//Create
			
			local trace = Instance.new("Part")
			trace.Anchored = true
			trace.CanCollide = false
			trace.Transparency = 0.7
			trace.BrickColor = BrickColor.new("White")
			trace.Material = Enum.Material.Neon --unit
			
			--//Calculate
			local distance = (hole.CFrame.p - position).magnitude
			trace.Size = Vector3.new(0,0, distance)
			trace.CFrame = CFrame.new(hole.CFrame.p, position) * CFrame.new(0, 0, -distance/2)
			trace.Parent = workspace --Hit
		
			tool.Handle.Fire:Play()
			Ammo.Value = Ammo.Value - 1
			--//Clean-up
			game:GetService("Debris"):AddItem(trace, 0.03)
			return
	else
		print("not enough ammo noob")
	return
	end 
end

NOT PRECISE GUN CODE:

local function  Shot()	
	if Equipped and not Reloading then
 local ray = Ray.new(Tool.Body.FirePart.CFrame.p, (Mouse.hit.p - Tool.Body.FirePart.CFrame.p).unit * 5000)
local hit,position = workspace:FindPartOnRayWithIgnoreList(ray, {Character, Camera})
if hit and hit.Parent then
Tool.Events.Hit:FireServer(hit,position)
end
if (not Aiming) then
StopAnimations()
PlayAnimation('Shot')
delay(0.2, function()
	StopAnimations()
	PlayAnimation('Hold')
end)
end
	local trace = Instance.new("Part")
			trace.Anchored = true
			trace.CanCollide = false
			trace.Transparency = 0.97
			trace.BrickColor = BrickColor.new("Ghost grey")
			trace.Material = Enum.Material.Neon --unit
		
			local distance = (Tool.Body.FirePart.CFrame.p - position).magnitude
			trace.Size = Vector3.new(0,0, distance)
			trace.CFrame = CFrame.new(Tool.Body.FirePart.CFrame.p, position) * CFrame.new(0, 0, -distance/2)
			trace.Parent = workspace 
		
			game:GetService("Debris"):AddItem(trace, 0.03)
end
end

Why do you have the camera in the ignore list? I’m pretty sure rays don’t collide with cameras as they are literally just CFrames with a couple functions/properties attached.

Well, because Fake arms are at the camera :slight_smile: Any idea what’s causing this?

idk, that’s the only difference I found with the raycasting