Can't jump while moving sideways or backwards

I have encountered an issue where the character won't jump while moving directly sideways or backwards in the TPC. This started when I set SpeedChange to automatic start. In debug, it never invalidates that the ability can't start, that is, canStartAbility never returns false. any idea what might be causing this?
 

Justin

Administrator
Staff member
I haven't seen this occur before but if you place a breakpoint within Jump.CanStartAbility you'll be able to determine if the ability is trying to start.
 
CanStartAbility() on jump is ran every frame it seems, so it is returning true constantly. Should this not be running each frame?
 
Last edited:
Also, it is registering the Jump button being pressed, just not sure where the disconnect is. No other function in Jump is being called, i tried putting stops in all of them but nothing is being called when I press the jump button. It works fine when moving forward or forward diagonal. Any other suggestions on where I can focus troubleshooting?
 

Justin

Administrator
Staff member
CanStartAbility() on jump is ran every frame it seems, so it is returning true constantly. Should this not be running each frame?
This relates to the ability message. In 2.1 there is an option to not check for ability start for that message.

Also, it is registering the Jump button being pressed, just not sure where the disconnect is. No other function in Jump is being called, i tried putting stops in all of them but nothing is being called when I press the jump button. It works fine when moving forward or forward diagonal. Any other suggestions on where I can focus troubleshooting?

Is AbilityStarted called? If CanStartAbility returns true then this method should be called at the minimum. You can also debug the animator by clicking on the Animator Monitor component and outputting the parameters to see if it is trying to transition. If it is then it is likely an animator setup issue and you can debug from there.
 
This relates to the ability message. In 2.1 there is an option to not check for ability start for that message.
where can I find this option?


Is AbilityStarted called? If CanStartAbility returns true then this method should be called at the minimum. You can also debug the animator by clicking on the Animator Monitor component and outputting the parameters to see if it is trying to transition. If it is then it is likely an animator setup issue and you can debug from there.

No, it is not called. nothing in the class is being called outside of the CanStartAbility() so i am having a hard time troubleshooting. I'll try the anim monitor, and this wouldn't be a surprise to me because I have made a lot of changes in the animations lately, thanks for pointing that out.
 
When I turn on the monitor, it doesn't tell me anything, no variables are changed when i try to push jump where as when not moving backwards they update correctly and the character jumps properly.
Also, this only happens when I have run set to an automatic start, when run is button pressed, this issue doesn't exist so I am thinking maybe it has something to do with the automatic ability starts?
 
hmm.. i commented out the StopAbility in the SpeedChange ability here:
Code:
// If RequireMovement is true then the character must be moving in order for the ability to be active.

            if (m_RequireMovement && !m_CharacterLocomotion.Moving || !m_CharacterLocomotion.MovingInRunningDirection()) {

                StopAbility(true);

                return;

            }
and now he jumps, so at least I've identified what is causing it, will continue to try and fix
 
Fixed it, had a function that stopped running when not running forward but it wasn't checking that in the can start for the SpeedChange so it was enabling and disabling each frame. Added it to the can start and its fine now, thanks for the help.
 
Top