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

Is there a way to ignore multiple things with raycasting?

Asked by 8 years ago

I'd like to know if there is any way to ignore multiple things on raycasting ( Such as EVERY PLAYER )

0
I apologize for requesting, its just there isn't a lot on raycasting in the wiki. deputychicken 226 — 8y

1 answer

Log in to vote
2
Answered by 8 years ago

LASERS AND RAYS AND LASERS AND RAYS

This question is fairly easy, I'm guessing you are using :FindPartOnRay(), but for this situation, We'll have to use FindPartOnRayWithIgnoreList.

FindPartOnRay has a "ignore" parameter, but it only has power to provide 1. FindPartOnRayWithIgnoreList accepts a table, with all the ignored objects.

something.Event:connect(function(...)
    local ignore = {everything ignored here}
    game.Workspace:FindPartOnRayWithIgnoreList(ray, ignore)
end)
Ad

Answer this question