Raycast wrong mouse position

Look my problem my bullets just fly in air


My script:

Can you help me?

send the formatted version of the script

local reps = game:GetService("ReplicatedStorage")
local Events = reps.Events
local player = game:GetService("Players").LocalPlayer

Events.Shoot.OnServerEvent:Connect(function(plr, pos, mousepos, damage, char)
	--Bullet
	local bullet = Instance.new("Part")
	bullet.BrickColor = BrickColor.Yellow()
	bullet.Anchored = true
	bullet.CanCollide = false
	bullet.Parent = workspace
	bullet.Transparency = 0
	bullet.Name = "Bullet"
	bullet.Material = Enum.Material.Neon

	--RayCast
	local rayOrigin = pos
	local rayDirection = (mousepos - rayOrigin).Unit
	local raycastParams = RaycastParams.new()
	raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
	local result = workspace:Raycast(pos, rayDirection*300, raycastParams)


	
	
	bullet.CFrame = CFrame.new(rayOrigin)*CFrame.new(0, 0, 0)
	bullet.Size = Vector3.new(0.215, 0.2, 1.078)

	local TS = game:GetService("TweenService")
	local Info = TweenInfo.new(0.4)
	local goaltween = {Position = result.Position}
	if result then
			TS:Create(bullet, Info, goaltween):Play()
	
	bullet.Touched:Connect(function(hit)
		
		if hit.Parent ~= char then
			if hit then
				if hit.Parent:FindFirstChild("Humanoid") or hit then
					hit.Parent:FindFirstChild("Humanoid"):TakeDamage(damage)
				end
			end
			wait(0.1)
			bullet:Destroy()
		end
	end)

end	
end)