Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics

We all use different programming languages here - I found from your profile that you use Unity - so I guess you're asking how to do this in Unity.  

Unfortunately, I don't use Unity, so can't help you, but for technical questions asking in their forums will probably get you an answer faster than asking here.

However, a quick search showed me these results - they're old so the code might have to be modified to newer versions - but it would point you in the right direction:

And more: