diff --git a/modules/wave_survival/player_detector.cpp b/modules/wave_survival/player_detector.cpp index e87adba6..2f8fcd9e 100644 --- a/modules/wave_survival/player_detector.cpp +++ b/modules/wave_survival/player_detector.cpp @@ -25,7 +25,7 @@ bool PlayerDetector::check() const { Vector3 const position{ get_global_position() }; Vector3 const target{ PlayerBody::get_singleton()->get_global_position() + Vector3{ 0.f, 1.5f, 0.f } }; // check if the target is in a view cone - if (forward.dot(target - position) < this->min_sight_dot) { + if (forward.dot((target - position).normalized()) < this->min_sight_dot) { return false; } // check if the target is in range diff --git a/modules/wave_survival/player_detector.h b/modules/wave_survival/player_detector.h index 83725821..a6e8b6c0 100644 --- a/modules/wave_survival/player_detector.h +++ b/modules/wave_survival/player_detector.h @@ -26,7 +26,7 @@ private: float max_hearing_range{ 100.f }; float max_sight_range{ 60.f }; - float min_sight_dot{ 0.7f }; + float min_sight_dot{ 0.6f }; double query_time{ 0.3 }; double query_timer{ 0.0 };