Okay i give up,i have checked the iwhole nternet (unity answers,forum…) in 3 days and i haven’t found ANYTHING USEFUL.
So here we go: How can i make AI Run Away from me if i enter in “trigger” or “zone” or whatever,it doesnt matter what triggers it,but what matters is HOW it is done,what logic or strategy i need,to make AI Run away from player,avoiding obstacles on its way and then when player is not in sight ai stops and switches to idle state…whatever. Like in video games when npc are in panic they just run away from player…
Actually i have very good knowledge in NavMesh,i have made my ai scripts very good and smooth,but to make them run away in random direction or … duhhhhh
Once the trigger is entered you can get the enemy location vector and the players location vector and subtract them, which would give you a vector pointing away from the player, for the enemy to travel.
If you got a nav mesh system you could use that vector and a distance to find a location to solve a path for.
If you want stupid simple you could just do a negative look at then move it forward, dodging obstacles with ray wiskers. Or you could place a nav point in front of it.
Sorry, that’s just from my limited reading on pathfinding.