Preparing

If the ability has been configured to prepare then the Preparing Aesthetic & Animation configuration will be made available for you to show graphics, modify movement and run animations.

Preparing graphics and animations can be setup to show a spell being casted or to have an enemy dash or teleport to a target before initiating the ability.

In this section you can setup the following:

  • Graphics to show whilst the ability is preparing stage

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

  • Control over restricting movement, and gravity

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

  • Option to move the entity to the current target/soft target whilst preparing (useful to get entity into position in front of target before initiating the ability).

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

Notable Settings

Setting

Description

Animation Clip

An animation clip can be selected to run whilst the ability is preparing, the animation will repeat until the ability preparation stage is over.

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 preparing, once the preparation stage is over the entity will be able to move again.

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 Preparing

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

Useful if the preparation 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.

Move To Target When Preparing

If enabled then the entity preparing the ability will move to the abilities current target during preparing. 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.

Defy Gravity

If enabled then the activating entity will defy gravity for a duration when the ability starts preparing, essentially making the entity float for a set time. This for example can be used for abilities which are charged in the air before being released to enemies below. 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 preparing. A particle object for example can be set here which indicates that the entity is casting a spell. If no object is added then no graphic will appear

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