Help with how to use Race and concurrency

To set up a race for the two you can try the following

race:
    run_lifetime()
    block:
        collectible.OnColleted.Await()
        # Deactivate the collectible
        # Add it to the stack

This way, the run_lifetime will be cancelled if the collectible is collected before it completes.

1 Like