Writing Custom Effects (Blueprints)

Other than using built-in effects and creating custom ones from the Editor, you can easily program custom Effects via Blueprints.


1. Effect Base Class

All you need to do is select the base class UAnimationEffectBase when creating a new Blueprint.

There are also some useful classes already available for you that you can view from the API, like the “UBehaviorEffectBase” or “UAppearanceEffectBase” which are intended for each effect category, “UBehaviorEffectSine” which already handles modifiers such as “a, f, w” and more.


By creating a BP from UAnimationEffectBase, you’ll find some methods to override, and in the docs (both Scripting API and in IDE) you’ll find more examples and info about new ones as well.

circle-exclamation

3. Modifier Methods

Since effects can be affected by “Modifiersarrow-up-right”, you can override the following methods to handle them in your animations:

These methods will be applied, in order, before the animation.

3.1 ResetContext

You can use this method to reset your animation’s variables to their initial state. For example, you could have a variable called BaseSpeed, but in your effect only use another called CurrentSpeed and have that variable be CurrentSpeed=BaseSpeed inside this method.

3.2 SetModifierTo

You can use this method to apply a modifier to your variables.

For example this will multiply the CurrentSpeed value by the s modifier (if there is any).

👍🏻 If you want to create a Behavior effect that has three modifiers such as “amplitude”, “frequency” and “waveSize”, you can create a Blueprint that inherits from BehaviorEffectSine which will handle them for you.

4. Animation Methods

Here are a few methods that you can override to create your custom animations.

4.1 GetMaxDuration

The max duration of the effect. This is used to calculate the total duration of an animation and have smooth transitions, but if you have an effect that never ends you should return -1;

4.2 CanApplyEffectTo

example: only apply the effect if the glyph is a number

Used to check if the effect can be applied to the current letter. For example if you’re creating an appearance effect, which only applies if a character passed time is within the effect’s duration (but in that case you can create a Blueprint from “AppearanceEffectBase” and have it handle that for you).

You can go beyond that, for example check if the character is a number or a letter, or their word index and much more.

circle-check

4.3 ApplyEffectOnFrameTo/ApplyEffectOnParseTo

4.3.1 ApplyEffectOnParseTo

example: make all glyphs bold when the effect starts

One-time function called when glyphs are first created.

  • useful if the effect has to perform one-time logic on the character, like initialization, or logic that is wasteful to perform each frame, like applying a style such as bold.

4.3.2 ApplyEffectOnFrameTo

example: make the glyph move in a wave-like motion!

Main function to apply an animation to a letter, called if “CanApplyEffectTo” returned true and executed once per frame.

  • Glyph holds all the information about the single character. It's passed by reference, which means you can directly modify it to animate it. For example, you may update its Glyph.Offset to move it around.

✅ Done!

You’ve completed all the steps necessary, yay! The more effects you add, the more this process will sound familiar and simpler.

circle-exclamation
circle-check

Have fun applying your effects!