Create a Finisher
Let's take a look at the Opportunity System by creating a finishing move, that will replace the primary attack, whenever the enemy's health is low.
This is an advanced topic, at least during the initial setup, since many steps are necessary to enable the Opportunity System. However, additional opportunity attacks should be easier to implement after the intial setup.
Contextual Animations
The Contextual Animation functionality from the Unreal Engine allows you to synchronize animation montages between multiple actors and fine tune how their positions.
Add the Required Components
Create the Animation Montages
Create the Roles Data Asset
Create the Contextual Animation Data Asset
Opportunity Attack
Continuing the Opportunity System, let's check the Gameplay Targeting System and then the Opportunity Attack Ability. We'll go through a finisher move executed when the enemy is low on health.
Create the Targeting System Data Asset
Create the Finisher Ability
Configure the Input Handler
Camera Animations
Opportunity Attacks can optionally use Camera Animations. Let's take a look how to configure the Player Camera Manager and how to create Camera Animations for these attacks, using the Level Sequencer.
Configure the Player Camera Manager
Set
NinjaCombatPlayerCameraManager
as the Camera Manager in your Player Controller.