diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-11-29 16:12:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-29 16:12:51 +0100 |
commit | 9725f33ac606ed4b26573015bcfdb86ed6741323 (patch) | |
tree | 8ca306af134f5b0a340f79e879acfb1f35d17f46 | |
parent | 38402fb49e80b9bb5ae5c3c8817d69feb5174576 (diff) | |
parent | ee14b172011e7b7be1c3026c6dfbbf696fad9843 (diff) |
Merge pull request #13392 from cbscribe/kcc_raycast_fix
Fix RayCast2D 'Exclude Parent' to include Area2D
-rw-r--r-- | scene/2d/ray_cast_2d.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/scene/2d/ray_cast_2d.cpp b/scene/2d/ray_cast_2d.cpp index 6ab20efdcc..a809023083 100644 --- a/scene/2d/ray_cast_2d.cpp +++ b/scene/2d/ray_cast_2d.cpp @@ -120,11 +120,11 @@ void RayCast2D::set_exclude_parent_body(bool p_exclude_parent_body) { if (!is_inside_tree()) return; - if (Object::cast_to<PhysicsBody2D>(get_parent())) { + if (Object::cast_to<CollisionObject2D>(get_parent())) { if (exclude_parent_body) - exclude.insert(Object::cast_to<PhysicsBody2D>(get_parent())->get_rid()); + exclude.insert(Object::cast_to<CollisionObject2D>(get_parent())->get_rid()); else - exclude.erase(Object::cast_to<PhysicsBody2D>(get_parent())->get_rid()); + exclude.erase(Object::cast_to<CollisionObject2D>(get_parent())->get_rid()); } } @@ -144,11 +144,11 @@ void RayCast2D::_notification(int p_what) { else set_physics_process(false); - if (Object::cast_to<PhysicsBody2D>(get_parent())) { + if (Object::cast_to<CollisionObject2D>(get_parent())) { if (exclude_parent_body) - exclude.insert(Object::cast_to<PhysicsBody2D>(get_parent())->get_rid()); + exclude.insert(Object::cast_to<CollisionObject2D>(get_parent())->get_rid()); else - exclude.erase(Object::cast_to<PhysicsBody2D>(get_parent())->get_rid()); + exclude.erase(Object::cast_to<CollisionObject2D>(get_parent())->get_rid()); } } break; case NOTIFICATION_EXIT_TREE: { |