Hello
I am currently working together with a composer to make music for a game im working on. He has composed 4 tracks, where 3 of them are working with parameters inside of unity. But one track doesnt update the parameter live inside unity. Although it works within FMOD studio when he changes parameters.
Have anyone had a similar bug? ie all tracks can change parameters inside fmod and unity except 1
No you can’t access it like this, if it’s global.
But if it works with your other events, what code do you use to access it? And finally, is your parameter global or local? I said to check that point, but it may not be the problem…
sorry i havent replied, have been busy with implementations. but yes thanks ill try it out. But i can set the other audio tracks by parameter in update, but there might be a bug with FMOD or the audio guy accidentally made one track global, ill check it out and get back to you!
void Start()
{
CurrentLevelMusic = FMODUnity.RuntimeManager.CreateInstance(PlayerStateEvent);
CurrentLevelMusic.start();
}
// Update is called once per frame
void Update()
{
CurrentLevelMusic.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(gameObject, GameObject.FindWithTag("Player").GetComponent<Rigidbody>()));
CurrentLevelMusic.setParameterByName("action points", actionPoints);
print(CurrentLevelMusic.getParameterByName("action points", out actionPoints));
}
so this is the code im using to set the parameter. The funny thing is, it works for 3 out of the 4 songs, but ill have to check if one is set to global.
btw is there a difference on local / global? on how parameters are set? sorry if its a dumb question,kinda new to this fmod stuff
No, the setting local/global is for the parameter only, it doesn’t concern the event which it’s used in. So the problem don’t seems to be this.
A global parameter shares its value to every event instances in the project calling it, the same value for all instances. A local parameter can have different values for each event instance.
Hmm ok that makes sense. So what you’re saying is that the global parameter will update all events that have a “reference” to it?
Hmm ill try to describe my setup atm.
So it’s an action game that will have different maps (scenes), and each map will have a separate track / background song that will play during the game. And each track have parameters that will change the track depending on what happens in the scene / game. So say you hit an enemy with an attack, then the song will change pace. And this is set up so, it will play certain sections for periods of time. Say first parameter 0 is the songs 0 to 20 second. and then when parameter 1 is set, it will play the next segment which is from 20-40 seconds.
And each map have their own event set up. So map 1 only plays track1, map 2 plays track2 etc.
And i can change parameter on each song / track except for one track haha. it’s really confusing because it works except for one.
It’s a bit weird. Maybe rebuild FMOD banks, you may have an older version of the banks. The bug could also be in the fmod project your composer implemented. You should do a Live Update session to determine what API calls are passed from Unity to FMOD and how FMOD reacts to that.
This is embarrasing, but, there wasn’t any bugs, the track was simply just a bit longer haha, so i had to wait untill the parameter triggered. Anyways thanks for the help though and have a good one!