Raycast not detecting

The raycast isn’t detecting parts

script.Parent.Shoot.OnServerEvent:Connect(function(player,size,speed,color,material,transparency,mousecframe,spread,lifetime,damage,headshot)	

	local CastBullet = workspace:Raycast(script.Parent.FirePos.Position,mousecframe)

	if CastBullet then
		print(CastBullet.Instance)
		if CastBullet.Instance.Parent:FindFirstChild("Humanoid") and CastBullet.Instance.Parent.Name ~= player.Name then
			if CastBullet.Instance.Name == "Head" then
				CastBullet.Instance.Parent.Humanoid:TakeDamage(headshot)
			else
				CastBullet.Instance.Parent.Humanoid:TakeDamage(damage)
			end
		end
	else
		warn("no")
		print(mousecframe)
	end

end)

the script always prints no even if my cursor is on a part

Here is the line in the client script

		script.Parent.Shoot:FireServer(BulletSize,BulletSpeed,BulletColor,BulletMaterial,BulletTransparency,Mouse.Hit.Position,Spread,Damage,HeadshotDamage)

Mouse is players mouse
image
Everything is the gun has cancollide and canquery off

The second parameter in workspace:Raycast is a directional vector not positional, so it would be the camera’s lookvector or camera:ScreenPointToRay(mouse.x, mouse.y).Direction most likely.

I don’t understand and I want the direction to face the mouse position

Ok then you would need to take the mouse’s position in world space and subtract it from the part’s position (origin) to get the direction (direction = goal - origin)