feat: lowered field of view for enemies

main
Sara 2025-01-05 18:58:37 +01:00
parent 4928f8663c
commit 80348d7ba7
1 changed files with 1 additions and 1 deletions

View File

@ -192,7 +192,7 @@ void Enemy::update_can_see_player() {
gd::Vector3 const target{this->player->get_global_position() + gd::Vector3{0.f, 1.8f, 0.f}};
// check if the target is in field of view
float const dot{(target - origin).normalized().dot(this->get_global_basis().get_column(2))};
if(this->current_action_fn != (ActionFn)&Enemy::chase_player && dot <= 0.2f && target.distance_to(origin) > 1.5f * 1.5f) {
if(this->current_action_fn != (ActionFn)&Enemy::chase_player && dot <= 0.7f && target.distance_to(origin) > 1.5f * 1.5f) {
this->can_see_player = false; // target not in field of view
} else {
// check if the sightline is obstructed by raycast