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?
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.