How to set First Person movement speed dynamically using blueprint?

Hi, I have searched the forum and found these two posts but I am still having trouble.

I am using the first person character template. I am trying to set the character speed dynamically to a value when the user presses a key.

I was able to get the Movement Component from the actor, but for some reason it gets returned as a Pawn Movement Component, which seems to not have a Set node for speed, only a Get node. The Character Movement Component does have a Set node, but my Pawn Movement Component cannot be cast to a Character Movement Component.

My goal is to increase or decrease player speed dynamically, when certain keys are pressed, using blueprint, on the default BP_FirstPersonCharacter blueprint.

I can achieve this effect “statically” by changing this variable in the editor, but I want to set it dynamically using blueprints.

Thank you for your help.

Can we see how you do this?

1 Like

Ah, just as I was grabbing the screenshot to paste here, I saw what I was doing wrong (was having a branch node sending the exec flow to the wrong place). My bad, the cast from Pawn Movement Component to Character Movement Component is actually working. THANK YOU!

Edit: for reference, here’s how I ended up doing it:

This cast works, and then I can SET the Max Walk Speed on the component. If there’s a better solution, I am all ears. Thank you again!

But why do all this? The component is here, drag it to the graph:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.