While I've never used it, the docs seem pretty straight-forward. Really, it just provides a way for you to define a set of nodes that a given RayCast2D
instance should not interact with.
So, for example, if your scene has a tree in it that you want your raycast to ignore, you can simply add the tree to the ignore list. So, assuming $RayCast2D
and $Tree
are valid node references in your scene, something like this:
$RayCast2D.add_exception($Tree)
With that, the raycast will not detect collisions with the tree. And, obviously, you can add as many objects as you want to the exception collection.
You can do similar things with collision layers or type masks. The add_exception()
method is just another option.