2D Side Scroller Sprinting

Hi, ive literally just started with Unreal yesterday, Ive followed some tutorials and I have a simple 2d level with flipbook animations. So far my character walks, jumps and can die. I have created a flipbook for sprint but have no idea how to actually implement it.

What I want is when i hold left shift and press either left or right that the sprint animation kicks in and the characters movement speed increases, and when i release it it goes back to normal walking speed or Idle.

Total newbie at this so any help would be greatly appreciated.

Hi man,
welcome to the Unreal4 !

Basically you have to detect the shift, using inputs, you can use the actionmapping in the project, or make your actor “enable input” and add a ShiftEvent.
You can test this adding a “print” to print something on the screen when you hit the shift.

Now, you have to build a flow of nodes, using “if” and “switch” and all the other nodes you may need
To create a behaviour.

When you press left or right, Check if Shift was pressed and hold ( for example make a boolean become true and false when you press and release the Shift.)
Now if you press left, and shift is off, use the Left_flipbook and move of 1 on the left
Now if you press right, and shift is on, use the Right_flipbook and move of 2 on the right.

**Once you get the basic work, **
**you can build a “vector” based behaviour, **
where you change the vector direction with Left and right,
And the magnitude with Shift
Or with shift you can enable another loop to increment your speed of 1 every time until your speed is equal to 50 or another variable you want.