How to set max walk speed to a different blendspace?

I’ve been scratching my head over this for a while. When my character’s health goes below 50 points, he switches to a different blendspace (he appears to be wounded when walking). The max walk speed of my basic blendspace (normal movement, idle walk run) is 600. The max walk speed of my wounded blendspace is 50. Of course, I don’t want my wounded character to move faster than 50. However, when wounded, I’m still able to use the run input action to reach 600 (even though when walking he reach 50 as expected). I don’t want my character to be able to run when wounded.

So that would lead me to 2 choices. I could either try to disable the run input button (shift) while my character is wounded. I tried casting to my character blueprint inside my animation blueprint, and then adding the run input from the casted node and adding a disable input. However, it just disables ALL of my input buttons. How can I disable a specific input?

Is there an easier way? I could try to limit the max walk speed of the wounded state so that I’m never able to go above 50 even when pressing shift. I don’t know how to do that either, and I’m not sure it’s really the right thing to do. Maybe I did something wrong in the blueprint?

Here’s what the even anim BP graph looks like if that can be of any help.

I also tried to plug the wounded speed var (instead of the speed var at the left) in the input of the set wounded speed variable but that didn’t work since the wounded walk animation wouldn’t trigger when moving (my character was sliding).

Not on PC but when your health is low set your walk speed to, let’s just say, 300. And that’s it.

Here’s how the node looks and it comes from the charactermovement component. This is an example I found on the net.

So here you can see when he holds shift his speed slows but when he release it goes to 300.

You just need to add a branch and when health < 40 set speed to 300.

oh my, that was simpler than I thought. Thanks again for your precious help. :slight_smile:

EDIT: Actually I’m almost there. :smiley: Now the only remaining problem is that when my character is switching to the wounded blendspace,he walks at 200 (default walk speed not wounded), but if I press the run button (shift) once, he’ll move at 50 as expected. If I press shift again when wounded, he doesn’t move faster than 50, so that’s fine. I must just find a way to make him move at 50 right off the bat without having to press the run button first.