Hei, I’m trying to setup a simple door open/close event which has a local parameter called state which selects which of the 2 sounds it should play.
I think I am doing everything right in Unity as well.
Walking through the door will always play the off (close) sound, even when parameter is set to 1 (on).
I used the FMOD Profiler to figure out if the parameter is being set, but it says it’s always off.
I use the exact same approach to setup footsteps and everything works fine there.
Am I doing anything wrong here?
It’s difficult to tell what could be going wrong. I would start by having as many
FMOD.RESULT checks on any and all FMOD functions it will allow. This should help in tracking down where it’s going wrong.
FMOD.Result always shows OK wherever I check, on Unity side.
I found a workaround where I add an extra labeled value in FMOD on top of off (0), on (1) -> I add ‘buffer’ (2).
With this setup, it works fine to set either 0 and 1.
Regarding using the same approach for the footsteps, it has the same result for the last value of the Surface parameter (7). If I set value 7 from Unity, it doesn’t work. Adding a new labeled value (8) to the Surface parameter, with no change on Unity side, works properly for value 7 (although it wouldn’t work for the value 8, which is a buffer anyway).
So the issue is that the last value from the labeled parameter is ignored on the FMOD Studio side.
I’ve been testing this for a while now but I cannot seem to replicate this issue. All labelled and discrete parameters behave as intended with the correct settings and values being returned. The off-by-one issue might be an issue in your code. I would recommend connecting Unity to your Visual Studio session and running a debug session with break points to see exactly where and how you are setting the parameter’s values.
EDIT: I’ve been informed by a fellow developer that there was a fix in FMOD Studio 2.01.03 for labelled/discrete parameters allowing 1 higher values of their max range to be set. Could you please update your FMOD Studio integration to the latest version and see if the same issue happens?