|
What is the code for the player to collide with and trigger a music source to the player to hear as an Audio Source not at the current position. Because I am having difficulty making the player collide with the trigger and everything would work but there would be no direct sound for the player to listen to. SO if you could help I would really appreaciate it. ALOT!
(comments are locked)
|
|
I am not sure if this is what you wanted but here is what i got out of it, I decided to add comments to make things easier for you.
Also, i didn't put a comment in there for it, but on the Audio Source comopnet that is added, make sure you have it set to Loop, if you want it to loop that is. Lastly, take a look at this for other Audio related scripting issues: Unity Scripting Reference: Audio Source Hopefully i have helped out, good luck and have fun with Unity!!
(comments are locked)
|
|
Not sure if I understand your question, but if you want to start a jukebox when a player is entering the room the only thing you have to do is attach a trigger collider to the jukebox that contains the room or area where the music should be heard. Then OnTriggerEnter start the AudioSource. If the clip attached to the AudioSource is marked as a 3d sound the music's level will depend on the distance of the AudioListener (probably attached to your cam/player) to the AudioSource. If you don't want that disable the clip's 3d sound property.
(comments are locked)
|

By "not at the current position" do you mean you want to trigger a sound somewhere else in the scene?
Just a note: you don't need to post your question again if it isn't immediately answered, its still on the site so reposting it just kind of clutters.
Yes to where you first start off by not hearing any music play untill you reach a certain point of the level Music would start to play like if it were HALO or somethin.