summaryrefslogtreecommitdiff
path: root/scene/3d/ray_cast_3d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/3d/ray_cast_3d.cpp')
-rw-r--r--scene/3d/ray_cast_3d.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/scene/3d/ray_cast_3d.cpp b/scene/3d/ray_cast_3d.cpp
index b71c54dcf9..b251aa38ba 100644
--- a/scene/3d/ray_cast_3d.cpp
+++ b/scene/3d/ray_cast_3d.cpp
@@ -259,6 +259,13 @@ void RayCast3D::remove_exception(const CollisionObject3D *p_node) {
void RayCast3D::clear_exceptions() {
exclude.clear();
+
+ if (exclude_parent_body && is_inside_tree()) {
+ CollisionObject3D *parent = Object::cast_to<CollisionObject3D>(get_parent());
+ if (parent) {
+ exclude.insert(parent->get_rid());
+ }
+ }
}
void RayCast3D::set_collide_with_areas(bool p_enabled) {