CHALLENGE 3: Re-Triggering a One-Shot Particle Burst Twice ==================================================================== TASK ---- Add a one-shot GPUParticles2D to a scene. Write a function that calls restart() on it, and call that function twice in a row a second apart (using await and a timer) to confirm a fresh burst genuinely happens both times, not just the first. SETUP ----- 1. Add a GPUParticles2D node. 2. In the Inspector, under "Emission Shape" / general particle settings, enable "One Shot". 3. Configure a short "Lifetime" (e.g. 0.5s) and a reasonable "Amount" (e.g. 20) so the burst is clearly visible. SOLUTION CODE (attached to the GPUParticles2D) --------------------------------------------------- extends GPUParticles2D func _ready() -> void: burst() await get_tree().create_timer(1.0).timeout burst() func burst() -> void: restart() OBSERVED RESULT ---------------- A visible particle burst plays immediately when the scene starts, finishes (since one_shot is enabled and Lifetime is short), and then a second, completely fresh burst plays again exactly 1 second later - not a silently-ignored no-op. WHY THIS WORKS AS AN ANSWER ---------------------------- This is a direct demonstration of the chapter's own warning: simply setting emitting = true a second time would NOT produce a second burst here, because a one_shot particle system that has already finished its single emission won't start a new one just because emitting is set back to true - that only resumes a continuous effect that had been paused. restart(), by contrast, genuinely begins a brand-new emission cycle each time it's called, which is exactly why it's the correct choice for a repeatable effect like this - an impact spark that should visibly fire again on every hit, not just the very first one. The await get_tree().create_timer(1.0).timeout pause (Chapter 7's own pattern) simply spaces the two calls out so both bursts are clearly visible as two separate events rather than overlapping into what would look like one longer burst.