So, I'm currently making a gun system, and for some reason, the ray is going through players when it's supposed to hit them, not sure if it's because i'm using UnitRay, but i'm stumped.
local unitRay = m.UnitRay
local ray = Ray.new(unitRay.Origin, unitRay.Direction * 750)
local hit, position = workspace:FindPartOnRayWithIgnoreList(ray, {workspace.Bullets, char})
local dist = (handle.Position - position).magnitude
remote:FireServer("shoot", {
pos = position,
origin = handle,
hit = hit,
ray = ray,
dist = dist
})
thanks in advance.

1 comment
you need to include the code that creates the ray