# Modifiers

<mark style="background-color:yellow;">**Modifiers**</mark> <mark style="background-color:yellow;">**let you change the characteristics of your effects individually**</mark>, without having to create new tags or scriptables for every variation.

`“I was <wiggle>strong</wiggle>… but now I’m<wiggle a*3> three times stronger</wiggle>!!!”`

<p align="center"><img src="https://content.gitbook.com/content/XuXUTa2X5PYuYL6yRvl1/blobs/gsZWN78ej2eibo2lDykv/text-animator-modifier-example-ezgif.com-video-to-gif-converter.gif" alt="" data-size="original"></p>

{% hint style="info" %}
You can read a list of all the available modifiers for each effect here: [built-in-effects-list](https://docs.febucci.com/text-animator-unity/effects/built-in-effects-list "mention")
{% endhint %}

***

### Values

To modify effect **values** (like an amplitude or speed),  write their **information inside the effect tag itself**.&#x20;

#### Multiply

Pattern: `<effectId`` `**`parameter*value`**`>`

<mark style="background-color:yellow;">The</mark> <mark style="background-color:yellow;"></mark><mark style="background-color:yellow;">**`*`**</mark> <mark style="background-color:yellow;"></mark><mark style="background-color:yellow;">symbol tells the code</mark> <mark style="background-color:yellow;"></mark><mark style="background-color:yellow;">**to**</mark> <mark style="background-color:yellow;">**multiply**</mark> <mark style="background-color:yellow;"></mark><mark style="background-color:yellow;">a</mark> <mark style="background-color:yellow;"></mark><mark style="background-color:yellow;">**float parameter by that value**</mark><mark style="background-color:yellow;">.</mark> This way you can easily know how much stronger/weaker a modified effect will result compared to the base one *(for this reason, a modifier of “1” will return the same result of a base value)*.

<details>

<summary>Example</summary>

* Make the `amplitude` of a "wave" effect three times stronger: `<wave a*3>`
* Make a "rainbow" effect two times slower `<rainb a*0.5>`

<figure><img src="https://3857371675-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXuXUTa2X5PYuYL6yRvl1%2Fuploads%2FaYNNPUoPShZQvpOqk37r%2FMultiply_Example_TAnim3.0-ezgif.com-video-to-gif-converter.gif?alt=media&#x26;token=6c9e5567-9463-4a0f-8565-f99712390eb7" alt=""><figcaption><p>wiggle five times stronger</p></figcaption></figure>

</details>

{% hint style="info" %}
The **`*`** symbol is only available for numbers. For strings, please use **`=`**
{% endhint %}

#### Set

Pattern: `<effectId`` `**`parameter=value`**`>`

<mark style="background-color:yellow;">The</mark> <mark style="background-color:yellow;"></mark><mark style="background-color:yellow;">**`=`**</mark> <mark style="background-color:yellow;"></mark><mark style="background-color:yellow;">symbol tells the code</mark> <mark style="background-color:yellow;"></mark><mark style="background-color:yellow;">**to set a**</mark> <mark style="background-color:yellow;"></mark><mark style="background-color:yellow;">parameter</mark> <mark style="background-color:yellow;"></mark><mark style="background-color:yellow;">**value directly**</mark><mark style="background-color:yellow;">.</mark> Especially useful when you need a precise movement/result in your text region, or if you are setting strings.

Example: writing "\<wave a=5>" is the same as going in the inspector and setting the wave amplitude to 5! (with the benefit, of course, that "\<wave a=5>" modifier uses that value only inside the text region you have set up, and will restore to default once you close the tag.)

### Keywords

<mark style="background-color:yellow;">**Some**</mark> <mark style="background-color:yellow;"></mark><mark style="background-color:yellow;">effects</mark> <mark style="background-color:yellow;"></mark><mark style="background-color:yellow;">**settings**</mark> <mark style="background-color:yellow;"></mark><mark style="background-color:yellow;">can also be modified via a</mark> <mark style="background-color:yellow;"></mark><mark style="background-color:yellow;">**single word**</mark>, without having to write any value next to it.&#x20;

Pattern: `<effectId`` `**`keyword`**`>`

Example: playing an effect just once using [playbacks](https://docs.febucci.com/text-animator-unity/effects/how-to-edit-effects/playbacks "mention"), writing **\<wave once>**

***

### Tips and Best Practices

* You can use multiple modifiers on the same effect tag!

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXuXUTa2X5PYuYL6yRvl1%2Fuploads%2FvBzBoXx71oIcJLmnyO3s%2FMultiModifiers_Example_TAnim3.0.mp4?alt=media&token=a42f7f81-29ab-4c4d-af2e-8b4969faf79b>" %}

* From the inspector, set up your effects as their "default state" / neutral tone. \
  This way it will become easier to modify parameters when you write dialogues, without having to remember precise values for each.\
  Once you have set up a neutral "shake", it will become easier when writing to know that "\<shake a=2>" will make it as twice as stronger (e.g. useful to make someone angry!)

Additionally:

* :thumbsup: You can use modifiers when declaring “[default/fallback](https://docs.febucci.com/text-animator-unity/how-to-add-effects#set-default-effects-to-the-entire-text)” effects as well (simply write them in the Inspector directly).
* :exclamation: Be sure to remove spaces between the modifierID, the ‘=’ symbol and its value
  * ❌ Wrong: `<wiggle f = 3>`
  * ✅ Correct: `<wiggle f=3>`
* :warning: If you write identical attributes in the same rich text tag, only the last one will take effect.

  Writing "\<wiggle **`a=2`** **`a=5`**>" is the same as writing "\<wiggle **`a=5`**>", since the first '**`a`**' parameter will be discarded / overwritten by the second.
