Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Ray going through players?

Asked by
sozzly 0
5 years ago
Edited 5 years ago

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.

0
you need to include the code that creates the ray hellmatic 1523 — 5y

Answer this question