diff --git a/modules/bullet/godot_result_callbacks.cpp b/modules/bullet/godot_result_callbacks.cpp index 68beea13ea9..989e14305c0 100644 --- a/modules/bullet/godot_result_callbacks.cpp +++ b/modules/bullet/godot_result_callbacks.cpp @@ -51,8 +51,8 @@ bool GodotClosestRayResultCallback::needsCollision(btBroadphaseProxy *proxy0) co if (needs) { btCollisionObject *btObj = static_cast(proxy0->m_clientObject); CollisionObjectBullet *gObj = static_cast(btObj->getUserPointer()); - if (m_pickRay && gObj->is_ray_pickable()) { - return true; + if (m_pickRay && !gObj->is_ray_pickable()) { + return false; } else if (m_exclude->has(gObj->get_self())) { return false; }