FragMate CommunityLog in

FragMate - Software and Game Developer Community, including Resources, Forums, Marketplace & More.

Share

descriptionHow do i add music?

more_horiz
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.

descriptionRe: How do i add music?

more_horiz
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.

descriptionRe: How do i add music?

more_horiz
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.

descriptionRe: How do i add music?

more_horiz
@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(); }"

_________________
-BryceCain25

descriptionRe: How do i add music?

more_horiz
Thanks for the help. ^_^

descriptionRe: How do i add music?

more_horiz
@Kunoru wrote:
Thanks for the help. ^_^
Sure thing Smile

_________________
-BryceCain25
Permissions in this forum:
You cannot reply to topics in this forum