How do i make an npc that runs away from the player?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Hashtop

Please help, i have been trying to do this in the past 3 days and failed miserably in the process.

:bust_in_silhouette: Reply From: kidscancode

One common approach to entity movement is by using “steering behaviors”. These are techniques that can be used to generate a wide variety of movement and behavior, from simple ones like “chase” and “flee” to more complex ones like “flocking” and “formation”.

Below is a link to a series of good tutorials on implementing these. The one you’d like to use is called “flee”.

Thank you helped me a lot

supper_raptor | 2020-04-07 06:25