- Home /
play sound while at certain coordinates of map (javascript)
This is my first project and I just need to be pointed in the right direction on how to do this. What I want to happen is something like: while gameObject is at this certain spot on the map, then play this sound. How would I go about doing this?
Would I want to create another gameobject and put it at the spot I need it and check whether the objects are colliding. Or, if possible, would I do the same but use an empty gameobject. Or would I use an actual command that checks whether an object is at a certain spot on the map. Or would I want to do something different?
Answer by edve98 · Mar 14, 2014 at 06:55 PM
Put box collider/s in place you want to sound to be playing and set it/them as triggers. Then use a script that plays sound when you collide with it or while you are in it (not sure what do you want exactly). You will probably need to tag your player as "player" and use that tag in a script. If you need some help wit a script just tell me, good luck with your game :)
Your answer
Follow this Question
Related Questions
Erasing a gameobject if you have the coordinates. 3 Answers
Stop audiosource clip from playing 1 Answer
Adjusting system audio levels... Please help! 1 Answer
Timer Scripting No Idea On Script 0 Answers