How to use make an AI detect light source and avoid it?

Hi, I am making an AI for a horror game and my AI will detect light source and avoid it. I have tried to search here, google and youtube. Maybe the keywords i’m searching for is not good enough that I cannot find anything about it.

Would like to know how to implement one in event graph for my AI.

You would need to work with collisions and traces for that.

The lights relevant to your AI should have a Sphere Collision on them, so when the AI enters its radius you begin tracing to see if there’s any direct line of sight. When they leave the sphere, yo stop tracing to them.

You could do a single trace to the center, or several to different parts of your character if you need it to be more precise.

That can be done in the behaviour tree ?

Yes it can. You could do all the checking and tracing from a Service node.