Skip to content

Reactions

The Reaction assets allow characters to react to different stimuli, such as being hit, blocking an attack, being the victim of a takedown, etc... They allow you to define a list of Animation Clips and one of them is picked based on different conditions.

For example, a character being attacked from the front might play a random flinch animation, but the same attack hitting its back might make it stumble or even get knocked down.

The Reaction Asset

To create a new Reaction asset, right click on the Project Panel and select Create → Game Creator → Melee → Reaction.

Melee Reaction Asset

The Reaction asset has a Transition In and a Transition Out field that define how long it takes for a character to blend in and out the selected animation from the reaction. It is recommended to have small values, such as 0.1 up to 0.5 seconds. By default, they are set to 0.1 and 0.25 seconds respectively.

The Use Root Motion checkbox defines whether the animation being played takes over the character's locomotion and will use the animation clip's root motion to move the character. It is checked by default and, in most cases, it should stay that way.

The Speed field is a coefficient that is used to speed up or down the animation played. By default it's set to 1, which indicates that the animation will play at its original velocity. Setting a value of 2 means the animation will play twice as fast, and a value of 0.5 will play the animation in slow motion.

Clicking on the Add Reaction button creates a new entry, of which you can create as many as needed.

Melee Reaction Entry

When a Reaction decides which animation is played, it starts checking all entries, from top to bottom. If the conditions of an entry are successful, then the animation played is picked randomly between the ones provided by that entry.

Entry Conditions

The Min Power checkbox determines whether the entry requires a minimum power in order to be considered successful. Upon ticking the toggle, a decimal field appears on the right side, which is used to define the minimum power threshold (1 by default).

Power from Skills

The power is provided by the attacker's Skill. This allows you to play different hit reactions depending on the power of the attack received, and play a knock-back animation when the strength of the attack taken is higher than a certain value.

The Direction field allows you to execute a particular entry only if the direction of the attack received matches the selected direction. The From Any option ignores the direction of the skill.

On top of these conditions, you can also specify visual scripting Conditions such as checking stats, and other kinds of data from both the attacker and the victim.

Self and Target

When checking Conditions the Self value references the character attempting to play a Reaction and the Target the attacker character.

Entry Behavior

The Cancel Time toggle allows you to define a minimum time, in seconds, after which the character playing the Reaction can cancel the reaction and play another Skill, dash or do any other action. When ticked, it uses a time of 0.5 seconds by default. If it is left unticked, the reaction can't be canceled.

Stun Locks

A Stun Lock is what happens when all attacks of an attacker character are faster than the reaction animation of its victim. If the aggressor constantly attacks a character, it can't break free because each new attack locks it in a new flinching animation.

To avoid that, try ticking the Cancel Time checkbox and give it a small threshold time. This will allow characters to attempt dashing out of the way after being hit but won't allow them to move during the reaction time.

This is especially useful for the player character.

The Rotation field allows the character to rotate before playing the animation. Follow Direction makes the character face the same direction as the attack (looking away from the attacker), Against Direction makes it face the attacker, and None doesn't rotate the character at all. This is usually useful when all your animations are frontal ones and you don't want to create directional animations.

Gravity determines the influence this reaction entry will have on the character's own gravity, using a value between 0 and 1. By default it's set to 1, which means the character is fully affected by gravity. Lower values are mostly used when doing airborne hit reactions, where the character stays up in the air while playing the hit animation.

The Avatar Mask allows you to play the entry animation clips on just a few bones of the character.

The Animation Clip list below determines all animation clips that are part of this Reaction Entry. If the conditions are successful, a random clip will be picked (without repetition) from the list.

Instructions

A Reaction asset also allows you to execute Instructions upon starting and/or exiting the animation. These instructions are guaranteed to be executed, even if the Reaction being played is canceled.

  • The On Enter instructions play as soon as the animation starts playing.
  • The On Exit instructions play as soon as the animation stops, or the reaction is canceled.

Running Reactions

At any given point a Reaction can be forced on a character using the Play Melee Reaction instruction.

Melee Reaction Instruction

All you need to specify is the character that's going to play the Reaction and information necessary for the correct selection of the entry.