toastvr
New Member
Posts: 2
Posts: 2
|
Post by toastvr on Sept 6, 2016 19:54:30 GMT
I'm fuming. Lost a day trying to fix this.... It causes errors 95% of the time.
using UnityEngine; using System.Collections; using DarkTonic.MasterAudio; public class testn : MonoBehaviour {
PlaySoundResult water1, water2, water3;
void Start () {
water1 = MasterAudio.PlaySound("water1");
water2 = MasterAudio.PlaySound("water2");
water3 = MasterAudio.PlaySound("water3");
} // Update is called once per frame void Update () {
//I use variables to update volume and pitch. One or more of these will fail. water2.ActingVariation.VarAudio.pitch = 2.1f; water2.ActingVariation.VarAudio.volume = .5f;
water3.ActingVariation.VarAudio.pitch = .3f; water3.ActingVariation.VarAudio.volume = .5f;
water1.ActingVariation.VarAudio.pitch = .1f; water1.ActingVariation.VarAudio.volume = 1f; }
}
//Please help!
|
|
|
Post by DarkTonic Dev on Sept 6, 2016 22:18:42 GMT
Check if ActingVariation is not null before trying to use it.
If it's null, nothing was played. If you want to know why it wasn't played then turn on LogSounds for the group and read the Console messages.
|
|
toastvr
New Member
Posts: 2
Posts: 2
|
Post by toastvr on Sept 7, 2016 4:28:08 GMT
Thanks for the tip. That was really helpful. I can go back to blaming myself instead of my tools now :-)
FYI, it helped me find that the child is busy...
"T: 0.02 - MasterAudio All children of water1 were busy. Will not play this sound for this instance."
So I'm guess I'm playing it more than I need to be.
|
|
|
Post by DarkTonic Dev on Sept 7, 2016 4:59:00 GMT
Cool. If you need to play it more then increase the Weight field to set the max voices.
|
|