MoveTowards Ability - still a little nervous of it!

DankP3

Active member
Sorry for the cryptic title, I am still finding that MoveTowards is locking up, seemingly randomly (perform the same action repeatedly just fine and then sometimes it locks).

I am still trying to understand all causes, but one easy one to fix is StopMovementAnimation. If it decides it is going to trigger, then you are locked permanently. this one is fixable by inheriting the ability and blocking it from starting, or stopping it, if MoveTowards is active. Since i can't think of a reason not to do this (yet), I thought i would suggest this as an improvement to that ability.
 
Hmm.. The Stop Movement Animation ability shouldn't affect move towards at all because it doesn't use an ability start location. Maybe this is related but I did fix a case where the Item Equip Verifier wouldn't play toggle the equip correctly when Move Towards activated.
 
So I didn't look in detail at what Stop Movement Animation does, but it activated when approaching a collider in front of the start location. There was no active forward collision, just the cast from StopMovement was hitting and the ability was active. The Move Towards was locked up and released when StopMovementAnimation was disabled in the inspector. Since i told the ability not to work if Move Towards was active, i have never had that issue again.

So in short, a third ability is activated, it starts MoveToward and movement begins to the start location and in this process the StopMovement Animation ability activates and blocks further movement preventing MoveToward from completing (disabling this ability allows Move Toward to complete and the third ability to continue).

EDIT: sorry, realise i never tried to repro with nolan in the demo scene, but i imagine if you setup a vault with a StopMovementAnimation casting far enough forward to prevent him reaching the start point the same would happen, i will check tomorrow.
 
Are you able to reproduce it within the demo scene? Where do you ahve hte Stop Movement Animation located within the ability list? The Stop Movement Animation should be positioned near the bottom of the ability list so it shouldn't have a chance to run when Move Towards is active or the ability that is being started by Move Towards.
 
I did edit above that I forgot to try in demo scene, i will try tomorrow. StopAnimationMovement is at the bottom of my list, but it is a concurrent ability? so presumably it is fine for it to activate during another ability.

EDIT, I am now wondering if i can trigger it midair by jumping into walls etc? I will try all these things tomorrow.
 
Ah, you're right. I checked and forgot that stop movement is concurrent.

I think that a solution would be to add the StopMovementAnimation to MoveTowards.ShouldBlockAbilityStart:

Code:
        public override bool ShouldBlockAbilityStart(Ability startingAbility)
        {
            return (startingAbility is Items.ItemAbility) || startingAbility.Index > Index || startingAbility is StoredInputAbilityBase || startingAbility is StopMovementAnimation;
        }
This will prevent stop movement from having a chance at starting when Move Towards is active.
 
And if you were stopped by StopMovementAnimation (ie. it is already active) and you interact with something to start MoveTowards, would that still work? I assume that would only block an ability from starting not stop it when already started?
 
Just for the record, in demo scene, if you set StopMovementAnimation with a large collision check distance, and then tell nolan to vault, the MoveTowards locks up, as described above (I used a large distance to enable the MoveToward to begin when at a distance from the vault). Perhaps worse, with a very short collision check distance, if you walk straight up to the vault (and see StopMovementAnimation go active - keeping you finger on forward movement button) and then try to vault, the vault animation plays, but the player is trapped in place by StopMovementAnimation. So i think the StopMovementAnimation needs to have careful thought on how and when it needs to be overridden.
 
I think that I have a good solution for this. Revert the change from Friday and instead open the StopMovementAnimation ability. Remove the IsConcurrent property so the ability is concurrent, and then add hte following to PredictedCollision (I added it after the first if statement):

Code:
            // Don't activate if a non-concurrent ability is running with a higher priority.
            for (int i = 0; i < m_CharacterLocomotion.ActiveAbilityCount; ++i) {
                if ((!m_CharacterLocomotion.ActiveAbilities[i].IsConcurrent || (m_CharacterLocomotion.ActiveAbilities[i] is MoveTowards)) && m_CharacterLocomotion.ActiveAbilities[i].Index < Index) {
                    return false;
                }
            }
 
Top