Animations

having problems with animations all I’m trying to do is when i press a key the animation plays i have a character that moves forward fine but the animation is not playing at the same time as the mesh is moving foward i did setup the input on project settings also does this have to be done in blueprint animation or animation asset?it works in animation asset but it keeps looping on its own i just want it to play the animation when i press the w key and the animation to stop when i let go of the key.