Unity Ninja Unity 3D Forum
To have exclusive access to all downloads, recourses and links within this forum, a free registered account is required. Just a heads up Wink
Share
Go down
avatar
Member [Lv. 2]
Member [Lv. 2]
Posts : 8
Points : 1442
Rep : 0
Join date : 2014-10-02
Age : 20
Location : United States
View user profile

How do i add music?

on Wed Oct 22, 2014 8:29 pm
Hey guys, I was wondering if anyone knows how to have music playing in the background of a game and if they are any way to have it play at a certain time. Help is much appreciated.
avatar
Admin
Admin
Posts : 608
Points : 3195
Rep : 406
Join date : 2013-12-11
Age : 21
View user profilehttps://www.youtube.com/user/misterninjaboy

Re: How do i add music?

on Wed Oct 22, 2014 10:49 pm
Set up an audio source on the object itself (can be any GO) with your audio listener. Have that source handle all the music for the game, and it should have a constant volume in all speakers. You can also set up an audio source somewhere in the world with a rolloff factor of 0. You'll run into it shifting from speaker to speaker depending on where it is relative to you, though. In terms of a certain time, can you be more specific? I can help you with that.
avatar
Member [Lv. 2]
Member [Lv. 2]
Posts : 8
Points : 1442
Rep : 0
Join date : 2014-10-02
Age : 20
Location : United States
View user profile

Re: How do i add music?

on Thu Oct 23, 2014 8:11 pm
What i mean by certain time is making music play during an event or when the player does an action or enter an area like the music in slender gets increasingly louder and dramatic as you progress and the drum sound effect occurs when you see him.
avatar
SUPER MODERATOR
SUPER MODERATOR
Posts : 279
Points : 2167
Rep : 58
Join date : 2013-12-16
Age : 17
Location : Boise Idaho United States
View user profile

Re: How do i add music?

on Sun Oct 26, 2014 12:52 pm
Kunoru wrote:What i mean by certain time is making music play during an event or when the player does an action or enter an area like the music in slender gets increasingly louder and dramatic as you progress and the drum sound effect occurs when you see him.
Use triggers with the audio source..
something like "OnTriggerStay () { AudioSource.Play(); } OnTriggerExit () { AudioSource.Stop(); }"
avatar
Member [Lv. 2]
Member [Lv. 2]
Posts : 8
Points : 1442
Rep : 0
Join date : 2014-10-02
Age : 20
Location : United States
View user profile

Re: How do i add music?

on Tue Oct 28, 2014 8:01 pm
Thanks for the help. ^_^
avatar
SUPER MODERATOR
SUPER MODERATOR
Posts : 279
Points : 2167
Rep : 58
Join date : 2013-12-16
Age : 17
Location : Boise Idaho United States
View user profile

Re: How do i add music?

on Sun Nov 09, 2014 6:01 pm
Kunoru wrote:Thanks for the help. ^_^
Sure thing Smile
Back to top
Permissions in this forum:
You cannot reply to topics in this forum