# Sound Behaviour

## Overview

This components allows to reproduce a random sound when an animation plays in the Animator Controller

<figure><img src="/files/lyBasmilniMv8skLkht1" alt=""><figcaption></figcaption></figure>

## How it works

When an Animation State is playing on the Animator, and it has attached the Sound Behaviour to it; It will add an AudioSource component to the Animator GameObject, in case if does not have any; and it will play a random clip from the Sound List.

## Parameters

### Source

GameObject to Store the Audio Source Component. This allows Animation States to share the same AudioSource.

### Sound List

List of Audio clips to reproduce randomly when the animation is played.

### Play On Enter

The sound will be played when the Animation Start to play

### Loop

If the Animation State loops, it will start to play every time the animation starts again.

### Stop on Exit

If the Audio Playing is longer than the Animation itself, the Audio will be stopped.

### Pitch

Sets the Pitch value on the Audio Source.

### Volume

Sets the Volume value on the Audio Source.

### Max Distance

The max distance that the sound will be played out from


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://malbersanimations.gitbook.io/animal-controller/global-components/animator-behaviours/sound-behaviour.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
