- Home /
change detail in game an the sound?
I have 2 questions
1) I want the volume level of an audio source changed more with a var in javascript and how is that possible?
2) how can I change the detail in the game itself? as at startup
plese help :(
Answer by spinaljack · Jul 04, 2010 at 10:40 AM
The audio source you use has a variable called volume which you can alter directly.
If the sound is mono and is a 3D sound it'll get quieter the further away it is from the camera (and its audio listener). You can also edit this effect with the rolloffFactor variable.
http://unity3d.com/support/documentation/ScriptReference/AudioSource.html
e.g.
audio.volume = 0.2;
Answer by Ashkan_gc · Aug 01, 2010 at 04:12 PM
AudioSource has a property called volume. if you have many audio clips you can play them with audio.PlayOneShot with different volumes.