AI to run away

Hi I’m new here and I need a little help . How do I make an AI char ( like a pig or deer ) to keep running away from me whenever he senses me near ( On see pawn, On hear noise ) ? Would help me a lot ,Thanks

I found a solution but is quite messy and perhaps inefficient, but if anyone is interested in it I can share it

i am interested in this as well if someone knows a solution

i am interested too