> ## 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 get a random player

> Here is a step-by-step tutorial to get random players

### How to pick a random player?

<Steps>
  <Step title="First Step">
    <Accordion title="The basics for all behaviors">
      1. Click on the asset to which you want to add a [behavior](https://wiki.soba.xyz/behavior-editor/managing-behaviors/behavior-object)
      2. With the object selected, click 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, click “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 the game starting. Select a “Trigger” box and drag it into the editor.
  </Step>

  <Step title="Third Step">
    Navigate to the controller [blocks](https://wiki.soba.xyz/behavior-editor/general/blocks) (Game Actions, Object, Effects, and Miscellaneous) and select your desired action. To pick a random player for that action, tap on "Player: Graph” and edit it such as if you were picking “All Players", shuffling them in a list with “Shuffle Players” and then picking the first result that comes with it using the “Pick first Player” node. Connect the resulting player to the 'Player’ [node](https://wiki.soba.xyz/behavior-editor/general/nodes-list). Follow the image below for further instructions.

    <Accordion title="Behavior Image">
      |                          Behavior Block                          |                       Nodes (custom graph)                       |
      | :--------------------------------------------------------------: | :--------------------------------------------------------------: |
      | <img width="250" noZoom src="https://i.imgur.com/7sxBRRJ.png" /> | <img width="600" noZoom src="https://i.imgur.com/47RaRXM.png" /> |
    </Accordion>
  </Step>

  <Step title="Fourth Step">
    Exit the Behavior Editor, playtest and ensure it works as expected!
  </Step>
</Steps>
