Initation

The Initiation Aesthetic & Animation configuration allows for you to show graphics, modify movement and run animations when the ability is initiated.

Animations that are setup here are very important for Melee type abilities as this will be the part where you configure what type of attack animation is used.

In this section you can setup the following:

  • Time when the ability appears in game after initiation has started

  • Graphics to show whilst the ability is initiating

  • Animations to run on the entity who is initiating the ability

  • Control over restricting movement, and gravity

  • Option to move the entity by an offset whilst Initiating (useful if root motion can't be used)

  • Option to move the entity to the current target/soft target whilst Initiating (useful to create dash/gap closers as you can attack whilst moving to the target)

Refer to the 5 Stages of An Ability to learn about what happens during and after the ability initiation stage

After Initiation - Activate Ability After Delay / Percentage

Found at the top of this screen is a setting named 'After Initiation Activate Ability' which allows you to select 2 options from a dropdown. Both options will allow you to control how long it takes for the actual ability object to appear in game after the initiation stage starts.

This allows for any breathing space for initiation animations/graphics/movement to play out before the fireball shoots out the characters hand or when the melee collider/trail graphic should appear at the vital swing point of a sword slash attack animation.

The following options can be selected:

'After Delay' will create the ability object in game after a set delay (timing starts when initiating begins)

''At Animation Percentage' will create the ability object in game once the initiation animation progress reaches a set percentage (%) value. For example you can set for the ability collider/weapon trail to appear at around 40% through the initiation animation at the key point of when the sword is about to swing and hit enemies.

The animation percentage can be found in Unity by clicking on the animation clip file and playing through the animation in the inspector noting the % value at the bottom of the preview when you have found the right point.

For the most accuracy 'At Animation Percentage' is the recommended dropdown to use when syncing ability object to the initiation animation.

Notable Settings

Setting

Description

Animation Clip

An animation clip can be selected to run when the ability initiates.

The animation clip defined will play on ABC's own Animation Runner system which means you can set to run animations without using Unity's Animator. To determine which animation to play simply select or drag and drop an Animation Clip into the setting. Once the clip has been selected you are able to add a delay before the clip runs and also set the speed of the animation.

Animator Parameter

The animation parameter system links directly into the Unity animation controller attached to the entity and is required for the animations to activate. To determine which animation to play the “Animation Parameter” which has been setup in Unity needs to be written in the parameter config box, then the matching parameter type needs to be selected from the drop down.

For example if Float parameter has been setup in Unity then the 'Float' option needs to be selected and float values need to be entered in the on and off button.

Restrict Movement

If enabled then the entity will not be able to move whilst the ability is initiating, once the duration is over the entity will be able to move again. If you enter 0 in the duration then the movement will be restricted whilst the initiation animation is running.

Once selected you are able to choose if ABC will freeze the position or disable the commonly used Unity movement controllers (Character Controller, Rigidbody etc)

Move Self When Initiating

If enabled then the entity activating the ability will move to an offset position when initiating.

Useful if the initiation animation being used has no root motion. After a defined delay the entity will move gradually to the offset position set, reaching the position after the duration provided.

Recommended that this setting is used if you are unable to use root motion in your melee attacks but want to push the character forward each strike

Move To Target When Initiating

If enabled then the entity activating the ability will move to the abilities current target when initiating. If the ability doesn't use targets (Forward Travel Type etc) then the entity will move towards the current target or soft target. Once ticked the below settings will appear allowing you to modify the delay before the entity starts moving to the target and how long it takes to reach the target. You can also define an offset to the target position and a stop distance which determines the position to which the entity will move to, for example stopping a certain distance in front to setup the initiation of the ability.

Using this functionality in the initiation stage can allow you to make dash attacks, you can animate a sword jump swing whilst ABC moves the character towards the target

Defy Gravity

If enabled then the activating entity will defy gravity for a duration when the ability is initiated, essentially making the entity float for a set time. This for example can be used for air combo attacks to keep the character in the air whilst attacking The system will stop the entity from falling by stopping any rigidbody velocity then turning off the rigidbody gravity for a duration.

Main Graphic

Any object can be added here which will appear when the ability starts initiating. A trail particle for example can be added to the current weapon equipped simulating a slash trail.

If added there is an additional option to detach the particle from it's parent after a delay to better simulate trails which might only follow the sword for a set duration.

This can also be used for showing a graphic when the spell is casted etc.

Restrict Movement & Deny Gravity Event

Within this configuration are tick boxes to enable ABC to 'Raise Events' when restricting movement or defying gravity.

If any of these tick boxes are enabled then it is possible to subscribe to a character's State Manager component to get notification of the events when they are raised.

To subscribe to both events you can use the following code from your scripts:

Restrict Movement Event

  private void OnEnable() {
    this.movementEventsABC = meTransform.GetComponentInChildren<ABC_StateManager>();
                                                                                           
        //subscribe to the event
        if (this.movementEventsABC != null) {
        this.movementEventsABC.onEnableMovement += this.EnableMovement;
        this.movementEventsABC.onDisableMovement += this.DisableMovement;
        }
    }
    
    public void EnableMovement() {
    //Code to enable movement
    }
    
    
    public void DisableMovement() {
    //Code to disable movement
    }
    
    
    private void OnDisable() {
        if (this.movementEventsABC != null) {
        this.movementEventsABC.onEnableMovement -= this.EnableMovement;
        this.movementEventsABC.onDisableMovement -= this.DisableMovement;
      }

Defy Gravity Event

  private void OnEnable() {
    this.gravityEventsABC = meTransform.GetComponentInChildren<ABC_StateManager>();
                                                                                           
        //subscribe to the event
        if (this.gravityEventsABC != null) {
        this.movementEventsABC.onEnableGravity += this.EnableGravity;
        this.movementEventsABC.onDisableGravity += this.DisableGravity;
        }
    }
    
    public void EnableGravity() {
    //Code to enable gravity
    }
    
    
    public void DisableGravity() {
    //Code to disable gravity
    }
    
    
    private void OnDisable() {
        if (this.gravityEventsABC != null) {
        this.gravityEventsABC.onEnableGravity -= this.EnableGravity;
        this.gravityEventsABC.onDisableGravity -= this.DisableGravity;
      }

It is highly recommended to read the tooltips in the blue boxes for a full description on what each setting does

Last updated