I’m not sure what I have to do, but I’m having trouble with making raycasts in my game ignore players. The script where the raycast is being fired from is a local script.
I have tried looking at other posts, but they seem to complicated and am unsure of how to implement it into my code.
Adding onto this reply you would have to do something like this:
local Exlude = {}
local OriginPosition = --Position here
local DirectionVector = --Direction here
for i, plr in pairs(game.Players:GetChildren()) do
for i, part in pairs(plr.Character:GetDescendants()) do
if part:IsA("BasePart") or part:IsA("MeshPart") then
table.insert(Exlude, part)
end
end
end
print(Exlude)
local Params = RaycastParams.new(Exlude)
Params.FilterType = Enum.RaycastFilterType.Exclude
game.Workspace:Raycast(OriginPosition, DirectionVector, Params)