> ## Documentation Index
> Fetch the complete documentation index at: https://wiki.soba.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# How to create a timer/countdown

### What is a timer (or countdown)?

A "countdown" mechanic in game design refers to a mechanic that has a timer or a time limit, adding a sense of urgency and challenge to the game. For example, a countdown timer can be displayed on your Soba game to require the player to complete a task within a certain time, and if the timer reaches zero, it may trigger an ‘End Game’ node.

<p align="center">
  <img width="500" noZoom src="https://i.imgur.com/x8Dgygb.png" />
</p>

### How to add a countdown to my game?

<Steps>
  <Step title="First Step">
    <Accordion title="The basics for all behaviors">
      1. Tap on the object to which you want to add a [behavior](https://wiki.soba.xyz/behavior-editor/managing-behaviors/behavior-object)
      2. With the object selected, tap on the “Details” button to the left of your screen.

      <p align="center">
        <img width="200" noZoom src="https://i.imgur.com/jMSZzP8.png" />
      </p>

      3. In the Details panel, tap “Add Behavior”.
    </Accordion>
  </Step>

  <Step title="Second Step">
    Decide what will trigger the behavior. This could be an action like a collision, an interaction, or an event. Select a “Trigger” box and drag it into the editor.
  </Step>

  <Step title="Third Step">
    Navigate to the “Effects” section. Here, choose the countdown block you want your asset to perform when triggered. For example, you might select “Start Countdown” to create some sense of urgency after a player touches an object. You also have other countdown options, such as Stop, Adjust, Pause, and Resume. Trigger them to tweak your countdown mechanic needs!

    <Accordion title="Behavior Image">
      <p align="center">
        <img width="300" noZoom src="https://i.imgur.com/lZPNxqk.png" />
      </p>
    </Accordion>
  </Step>

  <Step title="Fourth Step">
    Exit the Behavior Editor, playtest and ensure it works as expected!
    <Tip> Make sure to add a ‘custom graph’ to your countdown block. This connects the countdown result with specific players in your game. The example below picks the ‘first player’ on the custom graph, meaning that only this player will be affected by the countdown. <br /> <br /> <Accordion title="Behavior Image"> <img width="400" noZoom src="https://i.imgur.com/auOEI1d.png" /></Accordion></Tip>
  </Step>
</Steps>
