Make player stop moving after landing?

I’ve read numerous examples of how to apply force to a character, stop their movement, etc. None of the blueprints work for what I’m trying to do. I’ve tried them all, & tried making my own, no success. :frowning:

Let me explain:
My character’s “landing” animation makes him pause for about a short moment, then resume the “run” animation after the landing recovery.

The default 3rd person character controller, by default, does not take into account any sort of “landing recovery.” It just continues allowing movement with full velocity after a jump, no slowdown or pause whatsoever.

Unfortunately, the “recovery pause” I’ve made in my character’s Animation Blueprint does not apply to his actual acceleration/velocity, so even though is animation looks “paused” the character can still move around. Essentially he’s sliding over the ground after landing. His feet are not moving (as he’s recovering from the jump) but his body continues to move forward anyway. It looks very strange and I can’t progress forward until I figure this out.

The part of the “recovery” animation where the feet touch the ground occurs at the animation’s 36% duration point. I’ve tried using adding nodes in the Animation Blueprint to detect this duration, and then use the “Stop Player Movement” node once it’s detected. This never seems to take any effect though. I’m starting to suspect player movement can not be changed via an Animation Blueprint - is that correct?

I can add a similar setup to the character blueprint instead, but that blueprint does not give me access to the “recovery” animation’s “duration” node. So I have no way of timing the stop/start of character movement with it.

Thank you very much for the help, sorry if my explanation was a bit confusing. I’m not a coder, just a visuals guy, so this stuff really stumps me.

Disclaimer: I’m an animator and even to me this seems hacky :), but it seems to work. I’m sure someone will post a much cleaner, better solution, but for now, here goes…

First, I added two anim notifies to my landing animation. One called StopMoving where the feet hit the ground and one called StartMoving at the end of the anim to allow the character to get going again. When StopMoving fires, I set the MaxWalkSpeed to 0. Then, when StartMoving fires, I set the MaxWalkSpeed back to it’s normal value. What my eventGraph looks like:

Note that I’m storing the default MaxWalkSpeed in a variable at the top when the animation initializes and then using that variable to reset the MaxWalkSpeed after the anim finishes.

Hope that helps!

Hi,

I don’t know how to get the time from the animation because I don’t really know how to use that. But I can tell you how to achieve this in blueprint if you can specify the recovery time yourself.

Edit your character blueprint. Add 3 variables to it:

  • CanMove (boolean)
  • RecoveryTime (float)
  • RecoveryElapsed (float)

Add an EventTick event and plug it to the following node graph:

http://puu.sh/84Yeb.jpg

This will basically:

  • check if player is recovering (CanMove = false)
  • add the time elapsed since last frame to the total time recovered
  • if the time waited gets above the RecoveryTime it will reset CanMove to true to let the player move again

Now to stop your character from moving modify your movement input sections to first check that CanMove is true before changing player’s position:

http://puu.sh/84Yw9.jpg

Do that for movements and jump too and any input you want to block.

Now the only thing missing is to actually tell the player to stop moving when he lands. So add an Event On Landed node and from it set the CanMove variable to false:
http://puu.sh/84YE7.jpg

That’s it :slight_smile:

I was not too sure if he wanted to stop player input or change the speed even without any input. So I posted mine about stopping player input below.

Nice Greg! I didn’t see your method when I posted my answer. I wouldn’t have even thought of stopping the motion at the user input. I’m learning so much just looking at how everyone is tackling these problems.
Keep at it!

I’ve just found out about three nodes which may help you - Set Ignore Move Input, Set Ignore Look Input and Reset Ignore Input Flags (I work in 4.8.3). You will find screenshot in the topic below:

How can i trigger a camera with BP switch? - Cinematics & Media - Unreal Engine Forums

PS Sorry, I didn’t notice it’s such an old topic.