Run animation while key pressed

Hi, I want to make a character do the walk animation montage I imported while I press the W key and it moves. Currently it moves fine, but does the animation only once (for a few seconds). I tried to add a loop but I couldn’t figure it out. I’m a total beginner in this field so please help me.

In that kind of context. DO NOT USE ANIMATION MONTAGE.
You should use a state machine and animation sequence instead.
There are tons of tutorial videos on YouTube.

Thank you <3