Disabling character movement

Hi there!

Is there any way to disable character movement through a blueprint? I haven’t seen anything related to that in the forums.
In UE3 you could just use IgnoreMoveInput, but I don’t see such a function in UE4.

Thanks in advance.

1 Like

Hi Keytotruth,

The short answer is yes, but the long answer is yes depending on what you are trying to do! Blueprints are a very powerful tool and you can set up many aspects of your game through them, though if you have a button designated for movement that you do not plan on using (for instance, in a side scroller you may not want to turn left and keep them moving to the right instead), you can go into the axis bindings of the project settings and simply remove it from the list. If it is more of a temporary situation you can change the movement value to 0 so that your players forward or right vector will not update for a period of time. There are several options available to you to affect movement.

1 Like

I need more the latter. I want to make it so the player cannot move during a certain animation.
How can I set the forward/right vector to zero?

You can access the player controller and use the blueprint node Set Ignore Move. This will disable movement, you just need to re-enable the movement about the time the anim is done.

8 Likes

Thank you very much. That worked perfectly!

Also, do you guys know if it’s possible to restrict the axis for root bone motion for animations or montages like in UE3? I really need this feature. I don’t mind if it’s through code or something, but is it possible?

This seems to work: https://www…com/watch?v=6_sn34jLbBU

1 Like

The thing is: I just want to Disable the movement (not input). I can’t move but still can interact with the UI for example

If you’re using an anim instance to play montages like a melee attack and you want to stop the character dead in its tracks, the following code will do it:

This has the benefit of stopping just the movement and the player can use other controls e.g. left mouse button, other keys etc. In my case, I wanted to have the player be able to use melee combo attacks and enable/disable input to stop the character moving won’t work for me.

Hope this helps :slight_smile:

2 Likes

Thanks. But why doesnt that code work in a Function in my CharBP?

  • (Need to save space and want to add it as a Function (small node) before 5x movement/skill checks.)

Pic 2 does not work.
But the same code pasted in, instead of as a Function, does work.


I think the function needs to have a return node with a boolean on it. Think in the 2nd picture it’s always hitting true so it fires regardless if an animation montage is playing.

If the function returns true then it cant reach Add Movement Input and if false, it does.

Try this:

I’ve posted two versions that do the same thing :slight_smile:

1 Like

Ah yes, thank you. Everyone remember the Rule:

  • Function code needs Return nodes for every EXE Output (white pins) - cant leave a True/False pin blank - as I did here (as we usually can do in BP - but not Functions).