I think I fixed it, here’s what I did:
local function isObstructed(obj)--
print(obj)
rayParams.FilterDescendantsInstances = {game.Players.LocalPlayer.Character}
local castResult = workspace:Raycast(camera.CFrame.Position, (getPosition(obj)-camera.CFrame.Position)*REACH, rayParams)
print(castResult, castResult.Instance)
if obj:IsA("Model") then
for _, descendant in obj:GetDescendants() do
if castResult.Instance == descendant then
return not castResult
end
end
end
return not (castResult and castResult.Instance == obj)
end
(Will update you if I come across issues later down the line)
Thanks for your help, you were very helpful and I respect you for that! Have a good day/night!