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 :
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:
Use the automatic Distance parameter and just set GameObject positions in Unity.
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
Might there be something else I missed?