Run away a.i.?

Okay, so I am making somewhat of a horror game where you only have a flashlight and you are being chased but you can make that person (who is chasing you) go away by shining the flashlight on them, but I can’t seem to figure out how to do it?

If anyone know’s please help!

Thanks!

Sounds like a use-case for navmesh. When you shine a light on the monster, give it a destination somewhere far away from the player.

Any idea on how I would code that? (Sorry first time trying a run away ai)

A simple “flee” steering behavior might be easier. Here’s a tutorial on steering behaviors, and here’s the specific section on the flee behavior. The code is in ActionScript, but it’s very similar to UnityScript.

1 Like