Objects being picked by RayCast even when hidden and set as not ray pickable

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Ol_Smaug
:warning: Old Version Published before Godot 3 was released.

I am seeing some odd behavior after switching my project over from 1.1-stable to version 2.0. For some reason, certain objects in my scene that previously were ignored by a RayCast because they were hidden are now being picked when casting a ray from the mouse coordinates. I even tried setting their collision objects to not be ray pickable, but no luck.

When the mouse is over one of these hidden objects, the ray reports that it’s colliding with the hidden object, and the statement below prints out “False”, which doesn’t make sense to me.
print(ray.get_collider().is_ray_pickable())

Using ray.add_exception() seems to work fine, though, if I manually add the collision objects for my hidden nodes as exceptions.

Does anyone have any ideas what could have changed from 1.1 to 2.0 that would cause this behavior? Thanks in advance!

:bust_in_silhouette: Reply From: PlanetKiller

If your objects are static, or are kinematic that doesn’t move, try set_trigger( true ).
Or set the collision shape to null set_shape( null ) might work. You’ll have to do this on the collision shape node.