# Sound Behaviour

## Overview

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

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FX4HOviR5PEmxZrx5jWdx%2Fimage.png?alt=media&#x26;token=69f15b95-3abb-451f-b5cb-cfaad22cdb20" 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
