How to check if a sound plays a certain length?

Mxeaez
Thu, 19 Feb 2015 20:23:57 +0000
Audio

What I’m trying to do is when I look at a certain object in my map it starts playing a sound, and if I look away the sound stops playing. If the players keeps looking at the object too long and the sound reaches a certain point, they lose. So for example, lets say the sound lasts 5 seconds. If they look at the object it starts playing, and if they keep looking long enough for the song to play for 3 seconds, they lose, but if they look away before the song plays for 3 seconds, the sound stops and nothing happens. How would I do this? Thanks!

3 posts - 1 participant