Setting max walk speed in blueprint
I have set up simple sprint logic that increases the character movement's max walk speed when shift is pressed and sets it back to a base value when shift is released. I also print the "max walk speed" on these events. When I test the game, the desired values are printed but my character continues to walk at the same pace. Are there any other steps I need to talk to modify this value?
Hi Wes, Thank you for your response. The method you posted is another way to increase the "max walk speed". Increasing the max walk speed during play does not increase the rate at which the character walks, unless I am doing something wrong. The solution I came up with involves modifying the move portion of the blueprint (which was provided in the first person template). This feels like a super round about way to do this, and I would love to hear the way it actually should be done.
This is the code from the template that makes forward movement happen, notice I have redirected the move forward event chain to another area, depicted in picture 2. It also sets a scale value (Speed Factor) to "Add Movement Input":
This is the chain I added, It caps the max speed of movement, as changing the scale to a value other than one causes acceleration. It caps the speed to a maximum of (My Max Speed). On the right is my sprint chain. It sets the (speed factor) to either .01 for walking speed or .1 for running.
answered May 29 '14 at 02:31 AM
What is your Max Walk Speed float actually plugged in to? Your scale value on the Add Movement Input?
I am honestly not sure what is happening with your Set node there, but end result the Float needs to get fed into whatever is driving the movement. Everything else looks like it should work.
answered May 27 '14 at 09:59 AM
Jumping in with another way to possibly do this:
Have an Event Tick call a custom event called whatever (in this case Sprint). Left Shift is hooked up to a Gate Node which allows for the Max Walk Speed to be set to my Run Speed Variable (which is 600) whenever Left Shift is held. When I release, it sets it back to my Walk Speed Variable (which is 175).
Just to give you another way of approaching it.
answered May 27 '14 at 06:36 PM
DizzyWes ♦♦ STAFF
Follow this question
Once you sign in you will be able to subscribe for any updates here