Player death when see an object more than the deafult time

Hi all! :slight_smile:

I want to make an own Slender-like horror game.
My question is, how can I make, when a player see an object more than the default time, the player’s health begins to decrease, and then will die. But when the player cancel seeing the object, the player’s health begins regenerate.
I have a script already, when the player see the object a sound will be played. So how can I make a timed, triggered death?

http://answers.unity3d.com/questions/8003/how-can-i-know-if-a-gameobject-is-seen-by-a-partic.htmlhtml

Check the answer. It will help you to make camera check whether object is rendered/visible by it.

Google before you post a question.