Skip to content

Commit 27bbeb5

Browse files
committed
Guard script: Fix setting wait time
The timer node might not be ready. This fixes the current stealth level.
1 parent 00a2b8a commit 27bbeb5

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • scenes/game_elements/characters/enemies/guard/components

scenes/game_elements/characters/enemies/guard/components/guard.gd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,8 @@ func _set_patrol_path(new_patrol_path: Path2D) -> void:
395395

396396
func _set_wait_time(new_wait_time: float) -> void:
397397
wait_time = new_wait_time
398-
waiting_timer.wait_time = wait_time
398+
if waiting_timer:
399+
waiting_timer.wait_time = wait_time
399400

400401

401402
func _on_instant_detection_area_body_entered(body: Node2D) -> void:

0 commit comments

Comments
 (0)