From c0c82adef443fef31d895a6163a58dc54ba9fecf Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 24 Apr 2024 05:24:06 +0200 Subject: [PATCH] Add `randomize_on_ready` to `TimerStddev` --- behaviours/timer_stddev.gd | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/behaviours/timer_stddev.gd b/behaviours/timer_stddev.gd index 6a05b64..f238b91 100644 --- a/behaviours/timer_stddev.gd +++ b/behaviours/timer_stddev.gd @@ -9,6 +9,7 @@ class_name TimerStddev @export var deviation: float = 1.0 @export_range(0, 10, 0.1, "or_greater") var min_secs: float = 0.0 @export_range(0, 10, 0.1, "or_greater") var max_secs: float = 2.0 +@export var randomize_on_ready: bool = true func randomize_wait_time() -> void: @@ -17,3 +18,8 @@ func randomize_wait_time() -> void: Random.rng.randfn(mean_secs, deviation), max_secs ) + + +func _ready() -> void: + if randomize_on_ready: + randomize_wait_time()