Hello. I’m submitting this topic separately, as requested. For the project at hand, I’m using FMOD 2.02.05 and Unity 2021.3.2f1. This issue did not occur for me on another recent project, but that project also used different versions of FMOD and Unity. So, I’m wondering if my issue is a bug.
Anyway, the issue involves my music system. The music is three separate looped sections with lead-ins and Transition Timelines going into each, handled by a fair amount of Logic Tracks. To trigger the switch from one section to another, I have discrete global parameters set up that tell the track to go to the correct destination marker when the corresponding parameter changes from 0 to 1, after which other Logic Tracks take over to manage that section. The parameter immediately changed right back to 0 so that it doesn’t interfere with any of the other logic at that point. This system works great in FMOD, although, yes, I know there could be some better ways to set this up. This was a case where we had a tight deadline and the music system was being built alongside the game - not near the end of production.
In previous projects, I’ve been able to do this same thing by calling the parameter change from script like so:
void Awake()
{
FMODUnity.RuntimeManager.StudioSystem.setParameterByName(“EnterBossFight”, 1);
}
void Start()
{
FMODUnity.RuntimeManager.StudioSystem.setParameterByName("EnterBossFight", 0);
}
Simple stuff. This time, however, this was only sometimes working. The parameter changes in FMOD would get stuck. Sometimes they would switch to 1, but then not back to 0. Sometimes they’d switch another parameter to 1 instead, and then the music would get stuck in a weird loop.
I tried every permutation of that code, removing words in case documentation wasn’t updated, adding a “.” in between Studio and System, triple-checking spellings and cases, getting other eyes on the problem, turning the parameter to Local and calling it the way suggested in the kartGame tutorial code, etc., and no matter what I did, the parameters kept getting stuck on or off (1 or 0). This same code (different parameter), however, was also working perfectly to call another parameter change which was a float value, and that never got stuck.
To close this out, I tried too many things to concisely mention here, so please ask me any relevant follow-up questions in case I missed something (I was reaaaaaally tired the day the project was due), or in case you would like additional info. I just want to be able to fix this in the next version of the game, and I want to be sure it doesn’t happen in future projects if I’m just not doing something right.
Thanks for your time!