-- RAY
local rayParam = RaycastParams.new()
rayParam.FilterType = Enum.RaycastFilterType.Whitelist
rayParam.FilterDescendantsInstances = rayTable
local result = workspace:Raycast(hit.Parent.HumanoidRootPart.Position,Vector3.new(0,0,2),rayParam)
-- TABLE
for i,v in pairs(game.Workspace:GetDescendants()) do
if v:IsA("BasePart") and not v:IsDescendantOf(workspace.FX) and not v.Parent:FindFirstChild("Humanoid") then
table.insert(rayTable,v)
print(v)
end
end
Why is the raycast not working? There is no result even there clearly are parts. I printed “v” and it gave the parts i wanted, but the raycast doesn’t work. No error either, yes I tried putting the target position to a higher number but still no result. This used to work when I had it as a blacklist and I did my loop differently.