summaryrefslogtreecommitdiff
path: root/scene/2d
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-02-08 10:50:08 +0100
committerGitHub <noreply@github.com>2022-02-08 10:50:08 +0100
commit7e308d5120f61bcb70eb0afdbac35511484324d8 (patch)
tree82df07e48bacad02eb90cc3a2b1f2cc081e80901 /scene/2d
parent6b13056409dba9c9ac1bccce23fb9320d7c48725 (diff)
parentbbcd9c5b9781fdbebd2e03a6bf054d387d3df24c (diff)
Merge pull request #57791 from timothyqiu/raycast-clear-except
Diffstat (limited to 'scene/2d')
-rw-r--r--scene/2d/ray_cast_2d.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/scene/2d/ray_cast_2d.cpp b/scene/2d/ray_cast_2d.cpp
index 9521667854..51b3e676f9 100644
--- a/scene/2d/ray_cast_2d.cpp
+++ b/scene/2d/ray_cast_2d.cpp
@@ -279,6 +279,13 @@ void RayCast2D::remove_exception(const CollisionObject2D *p_node) {
void RayCast2D::clear_exceptions() {
exclude.clear();
+
+ if (exclude_parent_body && is_inside_tree()) {
+ CollisionObject2D *parent = Object::cast_to<CollisionObject2D>(get_parent());
+ if (parent) {
+ exclude.insert(parent->get_rid());
+ }
+ }
}
void RayCast2D::set_collide_with_areas(bool p_enabled) {