Detect BaseParts with CanQuery false without indexing first?

I am trying to detect BaseParts with the CanQuery property set to false without indexing them first, I’ve tried using Raycasting to return the hit BasePart, :GetTouchingParts() but this only works if the touching BaseParts have CanCollide enabled and a few other ways to no avail, is there anything else I could possibly try doing in order to detect these BaseParts and such?

I have seen this be done before, but I do not understand how it was done and I want to figure out how I could possibly do this myself. Please let me know and tell if me anything useful or interesting I could possibly do to get the same outcome.