Creating effects in the inspector
More than using built-in effects, you can also create your own directly from the Inspector, without having to code.
Last updated
More than using built-in effects, you can also create your own directly from the Inspector, without having to code.
Last updated
You're reading the documentation of an older/legacy version, Text Animator 1.X. To read the latest version, please visit this page instead . How to update:
P.S. if you're looking to create effects via code, you can visit Writing Custom Effects C#
Custom effects can either be local or global.
Local effects are applied only in the TextAnimator component that stores them.
To create a local effect, simply create one in a TextAnimator component in the category of your choice.
Global effects are shared and recognized between all TextAnimator instances, in all scenes.
They're stored in a Scriptable Object named "TextAnimator GlobalData
", inside a Resources folder.
(If your project doesn't have a Resources
folder, simply create it).
You can create a TextAnimator GlobalData
Scriptable Object from the Project's Context Menu (right click inside the project window).
After you've selected the effects container (TextAnimator component if you're creating a local effect, or the ScriptableObject if you're creating a global one):
Expand the effect category
Add a new effect
You can now edit the effect info and its different modules.
In the first section of the effect, you can find a text field where you can set the effectID (or effect tag).
👍🏻 If a local effect has the same tag (and type) of a global effect, the local effect will be applied.
After it, you can find a series of modules that control letters' over time. To create your effect, you can enable one, multiple or all of them.
These modules control each letter movement, scaling or rotation.
You can tweak the following values:
Amplitude
: represents the effect strength (it will also be multiplied by the curve intensity)
Chars Time Offset
: distributes the effect along letters (0 = all letters will have the same time, so, the same effect strength at a given moment).
Curve
You can also use AnimationCurves value to control how the effect is applied over time. You can specify their duration, tangents and post-wrap behavior. Read more about Animation Curves in the Unity Documentation.
Curves' intensity is applied differently depending on the type of effect you want to create.
For Behavior Effects:
Intensity over time
: controls the effect intensity over time.
Example, with an amplitude of 5: A curve value of 0 means that no effect is applied. A value of 0.5 means that the effect is 2.5. A value of 1 means that the effect is 5;
Usually you want this in the [-1, 1] range, starting from a value and loop back to it.
For Appearance Effects:
Decay over time
: controls the effect's decay over time. (So, the inverse of the Behaviors' curve.)
Example, with an amplitude of 5: A curve value of 0 means that the effect is 5, entirely applied. A curve value of 0.5 means that the effect is 2.5. A value of 1 means that the effect is 0 (has a full decay);
Usually you want this to start from 0 and reach 1.
Gradient
: sets a color value in a specified percentage. (example: If you have a duration of 5, the color on second "2.5" must be set at a percentage of 50%.)
Duration
: sets the module duration.
Chars Time Offset
: same description/utility as above modules.
The following modules are present only if you're creating Behavior effects.
Controls how the entire effect behaves during its lifetime (so, affecting all other modules).
Attack Curve
: controls the effect intensity at start 👍🏻 If you want the effect to start immediately, you can set set all this curve's keys' time to 1. 👍🏻 If you want the effect to start after X seconds, move the first curve's key's position and make it start after X delay.
Continue Forever
: true if you want the effect to continue forever after its start.
Decay Curve
: controls the effect intensity in the end
Cycles
: how many times the effect can loop (0 = infinitely, with the decay applied)
👍🏻 A total effect duration is calculated from: attackCurveDuration + [max duration between all other modules] + decayCurveDuration.