How would I make a bigger ignore list for my ray?

So I have a raycast system which draws a laser. The thing is that I want to there to be multiple ignored items, but if I try to do that in a table, it returns unable to cast value to an object.

local Ignore = plr.Character
local ray = Ray.new(tool.FirePart.CFrame.p,(mouse.Position - tool.FirePart.CFrame.p +  Vector3.new(math.random(-accuracy,accuracy),math.random(-accuracy,accuracy),math.random(-accuracy,accuracy))).unit * maxfiredistance)
local part, position = workspace:FindPartOnRay(ray, Ignore, false, true)

Also, if anyone has an idea on how to make my accuracy system better, help is appreciated.

You actually have to use the :FindPartOnRayWithIgnoreList method to be able to pass in an ignore descendants table, I believe.

local Ignore = plr.Character
local ray = Ray.new(tool.FirePart.CFrame.p,(mouse.Position - tool.FirePart.CFrame.p +  Vector3.new(math.random(-accuracy,accuracy),math.random(-accuracy,accuracy),math.random(-accuracy,accuracy))).unit * maxfiredistance)
local part, position = workspace:FindPartOnRayWithIgnoreList(ray, Ignore, false, true)
2 Likes