How do I calculate how much light is actually hitting a collider?

Hello,
I would like to develop a way where depending on how much light is hitting my character and at what intensity, I can get a returned value that will effect the AI of my other characters. Is there any way to do this or a Unity function that can calculate this?

Thank you,
Michael S. Lowe

How you actually calculate or code it, I don’t know – but here’s a suggestion:

Draw a ray from the light to your player, and if it doesn’t hit anything else (meaning the light is hitting the player) then the “strength” of the light could be equal to the distance of the ray. Like I said, I’m not sure how to actually code it, but it’s an idea.

Good luck! :slight_smile: