Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Adding multiple things to the "ignore" parameter in raycasting?

Hey guys.

I would like to know how to add multiple things to the ignore parameter in raycasting, usually people just use player.Character but I have an issue where the bullets get stopped by other bullets, is there any way I can add both things to the "ignore" parameter or a possible workaround? (such as placing the raycasted bullets into the character?)

And for reference, this is what I'm talking about: local part, pos = game.Workspace:FindPartOnRay(Ray.new(tool.Handle.CFrame.p,(mouse.Hit.p - tool.Handle.CFrame.p).unit*999),player.Character)

1 answer

✓ Accepted answer

What you're looking for is the FindPartOnRayWithIgnoreList method. It's identical to FindPartOnRay except that the 'Ignore' parameter is now a Table of Instances, rather than a single Instance. It will ignore any instances in the given table, and any of their descendants.

This discussion is preserved as it was. New answers, comments, and votes are closed.