ChannelGroup can no longer be null?

Hi folks,

I’m trying to update some old code (which I didn’t originally write), and the AudioManager script maintains a dictionary of named ChannelGroups. On initialisation of the manager it creates a number of entries in the dictionary and sets the ChannelGroup of each to null. This gives me the following error:

Argument 2: cannot convert from '<null>' to 'ChannelGroup'

So how can I set up the dictionary with its initial blank values that can then be populated by later scenes? I’ve had a poke around the documentation but I can’t find anything that looks helpful.

Thanks in advance.

Originally the FMOD types were classes so null was applicable, however they are now structs and thus value types. Each FMOD type has an internal “handle” member which you can assign IntPtr.Zero or use the clearHandle helper.

Aha! Awesome, thanks. That should let me get that code working again without having to tear it all down and build it up from first principles. :wink: