- Home /
How do you make a beeping noise when close to enemy? And how do you make it repeat faster the closer it is?
I have been working on a horror video game and it will be my first project on Unity. And I need an answer to this question. Thank you to anyone who can help. : )
Comment
Answer by jimmycrazyskills · Dec 19, 2018 at 06:20 PM
Hi mate you could try:
1. Check the distance between the two GameObjects
2. Add a sound source to the camera (you could make it looping on the component itself or via code)
3. Upon the distance going below a value trigger the sound source (your beeping) to play
4. Use the distance value to set the audio source pitch (which which change the pitch & playback speed of your sound effect, I'm not sure how to just change the tempo so the pitch is the same)
Hope this helps =D
Your answer