Hide a game object from all raycasts

I have a game object with 2 children, one of which is a colider

    - a GameObject
    - a Colider

The parent gameObject contains a script.

I want to make that colider invisible to all raycasts, is there a strait forward way to do this?


Easiest way would be to put it in the IgnoreRaycast layer.

Sure, put the gameobject and all it’s children on the Ignore Raycast layer.

Read the last sentence here: