Answered
0
0

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)

  • You must to post comments
Best Answer
1
0

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

  • Nexigen
    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.
  • Nicholas Wilcox
    You need to add the line ForestSound.start(); at line 31.
  • Nexigen
    That worked! Thank you! I'm so stupid. Seriously you have no idea how much I love you now. Thank you again!
  • You must to post comments
0
0

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.

  • Nexigen
    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?
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.