diff -r 9988e327176f -r 634fa2996d4e src/behavior.c --- a/src/behavior.c Thu Oct 09 19:03:32 2025 +0200 +++ b/src/behavior.c Thu Oct 09 19:15:02 2025 +0200 @@ -63,6 +63,7 @@ behavior->enabled = !args.start_disabled; behavior->always_enabled = args.always_enabled; behavior->killed = false; + behavior->unpaused = false; behavior->node = node; behavior->func = args.func; behavior->destroy_func = args.destroy_func; @@ -82,11 +83,23 @@ } void asc_behavior_trigger(AscBehavior *behavior) { - if (!behavior->enabled) return; - if (behavior->last_execution + behavior->interval > asc_context.total_nanos) return; - if (!behavior->always_enabled && behavior->pause_while_hidden && asc_scene_node_is_hidden(behavior->node)) return; + // the behavior is not enabled at the moment + if (!behavior->enabled) { + behavior->unpaused = true; + return; + } + // the behavior is not scheduled for execution + if (behavior->last_execution + behavior->interval > asc_context.total_nanos) { + return; + } + // the behavior is paused while the node is hidden + if (!behavior->always_enabled && behavior->pause_while_hidden && asc_scene_node_is_hidden(behavior->node)) { + behavior->unpaused = true; + return; + } behavior->func(behavior); + behavior->unpaused = false; behavior->last_execution = asc_context.total_nanos; }