How to set up a basic camera bob?

I’m trying to set up a simple camerabob that loops while the player is moving then returns smoothly to a neutral position once the player stops.

The first part I have figured out, the second part is what I’m struggling with. I’ve basically set them up both the same way using a vector timeline track for each and lerps however I’m not sure how to stop the loop and begin the ending animation.

My current blueprint setup basically just loops the headbob infinitely once the key is pressed, even after it’s been released. I assume this is because I need to stop the playing timeline once the key is released but I’m not sure how to do that and still play the HeadBob End animation?

Current BP for reference:

https://dl.dropboxusercontent.com/u/27624662/UE4Blueprints/HeadBobBlueprint.png

For anyone who is curious I managed to solve this by breaking it up into two pieces/timelines. Doesn’t seem like a very efficient way to do this but it works.

https://dl.dropboxusercontent.com/u/27624662/UE4Blueprints/HeadBobBlueprint_Working.png

Thanks, this is nice. Also in ContentExamples, Level Blueprint_Input_Examples they have Camera Shake on the Controller. Which you may want to use for something a bit more spicy like an explosion.

Could you post a quick how to on how you did this? I can emulate some of it, but being a complete novice I don’t know where some things are located or which option to choose. For example is “Player Camera” equal to my “First Person Camera”? And which “Set Relative Location” do I use? None of mine doesn’t say “Target Is Scene Component”. I also don’t know where any of this goes, should I add it inside my character Blueprint?