Dash Ability

artius

Member
Hi all, I'm trying to achieve something like Noctis, warp dash in FF15. I had the idea to use DOTween to get this to work, but I'm finding it difficult to navigate around UCC's built in movement code. Is there an existing integration or a documented set of steps for temporarily allowing another asset or script to control the player's position?
 
This will require scripting a new ability. Within the ability you can use UpdatePosition/UpdateRotation to have the controller follow a path.
 
I ended up using DOTween to calculate a new position, then I ran the below every frame to apply the new position.


C#:
public override void Update()
        {
            base.Update();
            if (vectorTween.IsActive())
            {

                ApplyPosition();

            }
        }

        public override void ApplyPosition()
        {
            base.ApplyPosition();

            m_CharacterLocomotion.MoveDirection = targetPosition - m_Transform.position;
        }

EDIT: So this only sort of works. It seems like the character still sinks while dashing, even though I disabled gravity.

EDIT 2: this ended up making my character pretty jittery. Instead, I used the CharacterLocomotion component's AddForce method. This gave me a smooth motion from start to end. One thing to note, the character will tend to overshoot their intended target. To solve this, I used SetPosition in the AbilityEnded method to halt my momentum and make sure I stopped where I wanted.
 
Last edited:
I ended up using DOTween to calculate a new position, then I ran the below every frame to apply the new position.


C#:
public override void Update()
        {
            base.Update();
            if (vectorTween.IsActive())
            {

                ApplyPosition();

            }
        }

        public override void ApplyPosition()
        {
            base.ApplyPosition();

            m_CharacterLocomotion.MoveDirection = targetPosition - m_Transform.position;
        }

EDIT: So this only sort of works. It seems like the character still sinks while dashing, even though I disabled gravity.

EDIT 2: this ended up making my character pretty jittery. Instead, I used the CharacterLocomotion component's AddForce method. This gave me a smooth motion from start to end. One thing to note, the character will tend to overshoot their intended target. To solve this, I used SetPosition in the AbilityEnded method to halt my momentum and make sure I stopped where I wanted.
Hey, Sorry for the bother, could you perhaps share your Dash Ability's script perhaps? I am using skinwalker's solution, but that approach causes the player to instantly fall when being airborne and trying to Dash.
 
Top