# SAudioReactiveAnimation

## Index

### Properties Index

| Property Name                                                                                                                            |
| ---------------------------------------------------------------------------------------------------------------------------------------- |
| bool [**Enabled** ](#enabled)`get` `set`                                                                                                 |
| [SAnimator](https://docs.breakroom.tech/scripting/client-scripting-api-reference/components/sanimator) [**Target** ](#target)`get` `set` |
| string [**Parameter** ](#parameter)`get` `set`                                                                                           |

## Properties

### Enabled

bool **Enabled** `get` `set`

*Returns true if the Audio Reactive Animation Enabled.*

{% tabs %}
{% tab title="Lua" %}

```lua
Space.Host.ExecutingObject.AudioReactiveAnimation.Enabled = false
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Lua" %}

```lua
--clicking this object will Enable/Disable it's Audio Reactive Animation component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.AudioReactiveAnimation


OnClick = function()
component.Enabled =  not component.Enabled
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)
```

{% endtab %}
{% endtabs %}

### Target

[SAnimator](https://docs.breakroom.tech/scripting/client-scripting-api-reference/components/sanimator) **Target** `get` `set`

*The target Animator which the Audio Reactive Animation is affecting.*

{% tabs %}
{% tab title="Lua" %}

```lua
TargetAnimator = Space.Host.ExecutingObject.AudioReactiveAnimation.Target
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Lua" %}

```lua
--clicking this object toggles between two Audio Reactive Animation targets

thisObject = Space.Host.ExecutingObject
animator1 = Space.Host.GetReference("object1").Animator --add this reference to Scripting Runtime component
animator2 = Space.Host.GetReference("object2").Animator --add this reference to Scripting Runtime component

OnClick = function()
if thisObject.AudioReactiveAnimation.Target == animator1 then
  thisObject.AudioReactiveAnimation.Target = animator2
else
  thisObject.AudioReactiveAnimation.Target = animator1
end

end

thisObject.AddClickable() 
thisObject.Clickable.OnClick(OnClick)
```

{% endtab %}
{% endtabs %}

### Parameter

string **Parameter** `get` `set`

*The Parameter value which the Audio Reactive Animation is affecting in the target Animator.*

{% tabs %}
{% tab title="Lua" %}

```lua
Space.Host.ExecutingObject.SAudioReactiveAnimation.Parameter = "param2"
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Lua" %}

```lua
--clicking this object toggles between two Audio Reactive Animation parameters

thisObject = Space.Host.ExecutingObject
parameter1 = "theParamName"
parameter2 = "theParamName2"

OnClick = function()
if thisObject.AudioReactiveAnimation.Parameter == parameter1 then
  thisObject.AudioReactiveAnimation.Parameter = parameter2
else
  thisObject.AudioReactiveAnimation.Parameter = parameter1
end

end

thisObject.AddClickable() 
thisObject.Clickable.OnClick(OnClick)
```

{% endtab %}
{% endtabs %}

### GameObject

[SGameObject](https://docs.breakroom.tech/scripting/client-scripting-api-reference/types/sgameobject) **GameObject** `get`

*Returns a reference to the GameObject of this component.*

{% tabs %}
{% tab title="Lua" %}

```lua
theGameObject = Space.Host.ExecutingObject.AudioReactiveAnimation.GameObject
```

{% endtab %}
{% endtabs %}
