diff --git a/modules/wave_survival/player_detector.cpp b/modules/wave_survival/player_detector.cpp index 6869cccf..6f1b5bdb 100644 --- a/modules/wave_survival/player_detector.cpp +++ b/modules/wave_survival/player_detector.cpp @@ -73,6 +73,9 @@ void PlayerDetector::_notification(int what) { // check if there is geometry between detector and player bool PlayerDetector::line_of_sight_exists() const { + if (!is_inside_world()) { + return false; + } PhysicsDirectSpaceState3D::RayParameters params{ this->ray_params }; params.from = get_global_position(); params.to = PlayerBody::get_singleton()->get_global_position();