How to make a light turn on when entering a room

I’ve been looking around and i cannot find anything about this, how do i make a point/spotlight turn on when i enter the room without have to use a light switch. I only want it to turn on when i walk in. Im making a little project where you are in complete darkness and the only way to navigate is to throw spheres and follow it. Also how do i make it that the spheres dont trigger the light?

Place your player(s) on a layer called “Player” or something like that. Or tag it as “Player”.

Place a Box Collider with isTrigger=True that encompasses the room.

Place a script on your player or collider that uses OnTriggerEnter to turn on the light. Have your script check the tag or layer of the collider to make sure it is the/a Player.

Use OnTriggerExit to turn off the light, if necessary.

NOTE: If your rooms are not rectangular, place a collider at each door. Then OnTriggerExit will need to check one of these values: direction, velocity, side of collision; in order to determine if the player was entering the room or exiting it.

Hope that helps!