Hi,
I have an audio source on my main character, walking steps sound which has been dragged into the audioclip and works fine.
I also have these gems objects that I collect and the script for the gems is on my main character and i use the following code for the gem script
- var gemsound : AudioClip;
-
- function Start () {
- GetComponent.().clip=gemsound;
- }
-
-
- if (Col.gameObject.tag==“gems”)
-
- {
- Destroy (Col.gameObject);
- collectablesdata.GetComponent.().gems = collectablesdata.GetComponent.().gems +1;
- GetComponent.().clip=gemsound;
- GetComponent.().Play();
- }
this script works but the sound on the gem sound, sounds distorted or like its conflicting with the main character footstep sound. what i noticed was if i turn down the volume on the audiosource(the one for my main character foot steps) it also affects the volume on the gems…I need to seperate them so i can control both sounds , whats the best way? i’m using unity 5.
Thanks