Bus get channel group returns undefined only until the event plays

In my game, I want to adjust the pitch level of all sounds according to the game speed, for this I get the SFX Bus and try to get the channel group with get channel group, but it always returns undefined, but if I play any event, this time it returns me id, then I set the pitch level with sfx_channel_group.set_pitch(), but when the event stops, sfx_channel_group.set_pitch() returns an invaild object error

Hi,

You can use FMOD Engine | Studio API Reference - lockChannelGroup to force the system to create and keep the channel group available until unlock is called.

Hope this helps!

Hi if I use lockChannelGroup at the beginning it works but when I do unlockChannelGroup it returns undefined again. what if I do lockChannelGroup at the beginning of the game and never unlock? because I always have to adjust the pitch level of the channel group to delta time throughout the game.

Locking at the beginning of the game is the way to go. However, you want to lock it again when the game ends or the FMOD system will not clean up its resources correctly. Lock can be called when the game is closing down.

Hope this helps