Changing movement speed of pawn

Ok so here’s the problem:
I’m trying to make the sprinting movement mechanic so i tried 2 ways and both failed miserably.

  1. My movement is WASD for up/down etc. i got top down look, i made it using add movement input and tried to modify scale value so it changes speed but just doesnt seem to react to any value change i make ( nothing happens except direction change if its negative value)
  2. Went to pawn blueprint and tried to make it so key input (shift) when pressed changes the max speed value and released changes it back to normal. Failed again, tried to print the value but nothing happened it seems like input is not even received.

Third thing is just curiosity about the world direction value in add movement input node what does it mean? No matter what value is put in here it works only as positive/negative value.

Thanks for any explanations.

Does it matter if its pawn or character blueprint i used top down template and i think the bp is pawn type, i tried that when i push shift it sets maxwalkspeed and then when i release it sets back to normal value but it doesnt even react to shift input. Is it the matter of blueprint ?

Is there other node to add movement to the pawn then addmovementinput ?

i haven’t used the top down template, but if it has a movement component, it should have a velocity that you can set.

yes it has and when I change the value in details it works, but when i want to do it by input event shift on press it doesnt even notice that shift is pressed ( checked by printing, nothing happens) any idea why it doesnt answer when i press shift ?

In addition i just found out that when i try to place input action “sprint” node that i set in project settings as left shift in pawns blueprint to try do it again setting max walk speed etc, it just crashes every time.

Also found out that when using for instance twin stick template where player character is blueprint character instead pawn u cannot get refference to movement component ?

make sure your player controller doesn’t already have a shift key input node that is overriding your pawn, and in all of your input nodes, turn off consumeInput and overrideParent, and use printString to test if they are working.

i have no idea why adding an input action called “sprint” would crash the editor, but if you post the crash log it might be easier to debug. does it crash if you rename it?

also, all characters have movement components, its a native component that you can’t remove, so if that isn’t showing up, you are either not looking at a character, or you might need to reinstall UE4.

Ok so I did as u tell: turned off all consume input and override, also removed input action from controller and then tried to do what I wanted but again crashes every time i put input action node in the pawn bp.
The thing with movement component is still true i cant find it in twin stick shooter template, cant create one too in components list.
I did all of that after reinstalling engine.

I have finally succeded changing the maxwalkspeed by pushing shift.
I achieved it by creating whole new project, created new character blueprint and all input logic was put inside the character instead playercontroller. ( didnt work in previous project).
My question now is what is the function of the player controller bp then?
I think I havent solved the problem just gone around it.

so you cant add any key input events to your pawn’s graph without the editor crashing? but you can add and remove key input events from your player controller?

are you using action mapping key bindings, or regular key input events?
also which UE4 version are you using?

have you tried setting the console command “t.MaxFPS 30” in the editor window, then trying to add inputs to your graph?

Crash occurs when adding input action, version is 4.5.1 i can add and remove key inputs from player controller, i also wrote up some bypass to that problem.

https://docs.unrealengine.com/latest/INT/Gameplay/Framework/Controller/PlayerController/

Is there any way to get reference to movement component of the controlled pawn in the player controller blueprint?

getControlledPawn, Cast to YourPawn, then you should be able to find getMovement or getCharacterMovement or whatever its called for your pawn.

It solves the problem 100% thank you very much.