Sound in Fmod, but no sound in Unity. Tried everything!

Here is my problem:

I can successfully integrate sound Events from fmod to unity. When I do that, I hear sound in both fmod and unity. However, when I (in C#) try to change the volume with a parameter set to increase volume when getting near an object and to lower the volume when the object goes farther away, I don’t hear any sound at all. I don’t have a 3d panner in my master, the script has been compiled and deemed bug-free and when I trace my parameter value it actually goes up and down when nearing or stepping away from an object. Still… there is no sound. Again, I do have sound when I only integrate events in unity and let them play, but this specific C# distance thingie I’m trying to implement is not giving me any sound. I’m not even sure whether it is the script or something else.

The object in game which has my studio event emitter attached to it is called BattleCylinder.
You can view the script here, I made a pastebin :

http://pastebin.com/9aGzycZ4
(Everything commented out is not -i think- relevant)

FMOD Studio has several automatic parameters and Distance is one of them. The automatic Distance parameter is updated using the emitter’s GameObject transform and the listener’s GameObject transform for you, and it will override any attempt to set it manually.

You can do one of two things:

  1. Use the automatic Distance parameter and just set GameObject positions in Unity.

  2. Create a normal parameter not called Distance, and then set it manually as you have been doing.

I tried changing the name from Distance to musicDistance. This resulted in the same problem, no sound. So I tried using the automatic distance parameter. This resulted in the value actually being changed from 0 to 1 to something entirely else. It gave me an error too.

NullReferenceException: Object reference not set to an instance of an object
DistanceScript.Update () (at Assets/Plugins/FMOD/DistanceScript.cs:46)

So unfortunately both of these options are sadly enough not working :frowning:
Might there be something else I missed?

Your script needs to call the Start() method on the EventInstance object.

1 Like

What do you mean exactly? I do have the Start() function typed as : void Start () {
}

In there I set the parameters and double check if the objects are linked.

You need to add the line ForestSound.start(); at line 31.

That worked! Thank you! I’m so stupid. Seriously you have no idea how much I love you now. Thank you again!