Boogeyman enemy

Hi, I have a question for you beautiful people out there. I’m currently trying to figure out how to go about doing an enemy wich act like the one in Boogeyman. For those who don’t know, the enemy start to come out of a window or closet and if your not quick enough to use your flashlight on him he will kill you but if you are he will go back hiding.I recommend to go watch a video since I’m not sure how to explain it and my english is pretty bad. But to get back to the point of this post I was wondering what would be the best approach to this. I was thinking of playing a matinee on a certain event that would play the animation but I don’t know how to go about him going back to hiding if I use my flashlight on him. Any suggestions?

Thanks in advance.

just line trace out from your flashlight and when it returns a hit on the ai cast to said ai and play the animation to hide