the ray will not collide with anything. The opposite happens with FindPartOnRayWithWhitelist, where it will collide with everything, even if it’s mentioned before the nil in the list.
For an example, check out this repro place in studio:
This is probably because everything is considered a descendant of nil. I will look into this.
print(game.Workspace.Baseplate:IsDescendantOf(nil)) → true
local function fixIgnoreList(list)
local list2 = {}
for _, v in pairs(list) do
list2[#list2 + 1] = v
end
return list2
end
workspace:FindPartOnRayWithIgnoreList(ray1, fixIgnoreList({nil, workspace.Baseplate}), true, true)
I have modified my code to not include nil values in my array of ignored objects, my point is that I shouldn’t have to. Roblox needs to fix something because this has had me stumped for days and I’m sure I’m not the only one.