Animated enemy on overworld & start battle after touching it

Hi everyone ! I tried to search for a similar thread but I couldn't find anything. ( maybe I was searching with the wrong keywords? Idk soz)
I wanted to ask you all if you knew a way to animate an enemy on overworld and make it start a battle when being touched.
I'll give you more informations about my idea; in poor words I have made a sprite sheet of this enemy, and when you enter a map where it is placed, I would like it to start an animation while staying put. ( it is a basic animation, it just goes up and down in loop, but without changing tile) I tried to set a loop for it, so it will continue to be animated until it is approached and defeated, but if I try to set a switch ( in order to make an event where if it is touched, the battle starts) the loop stops 'coz the new event is activated & the previous one goes off.
Is there a way to make it do both at the same time?
Thank you all in advance

Original thread: https://forums.rpgmakerweb.com/threads/animated-enemy-on-overworld-start-battle-after-touching-it.132798/