Search Issue Tracker
Fixed
Fixed in 2021.3.40f1, 2022.3.32f1, 6000.0.4f1
Votes
0
Found in
2021.3.34f1
2022.3.20f1
2023.2.9f1
2023.3.0b5
6000.0.0b11
Issue ID
UUM-61733
Regression
No
[Crash] Adding AudioListener component with OnAudioFilterRead crashes the editor
When removing the audio listener on a game object and adding it back, it crashes the editor if the game object has a script with OnAudioFilterRead attached to it.
Repro
- Download the attached `OAFR.cs` script.
- Create and open an empty project.
- Import the `OAFR.cs` script.
- In the SampleScene, add the OAFR component to Main Camera.
- Remove the audio listener component.
- Add an audio listener component.
- If the editor does not crash, do the following:
## Remove the OAFR component.
## Repeat steps 4-7
Expected: No error is thrown in the console and the editor does not crash
Actual: An error might be thrown in the console and sometimes the editor crashes.
Note
Sometimes the editor doesn't crash but an error is thrown in the console, which might hint at the problem.
Stack trace (crash)
See attached `Editor.log`.
Stack trace (error)
{code:java}
GameObject has multiple AudioSources and/or AudioListeners attached. While built-in filters like lowpass are instantiated separately, components implementing OnAudioFilterRead may only be used by either one AudioSource or AudioListener at a time.
The reason for this is that any state information used by the callback exists only once in the component, and the source or listener calling it cannot be inferred from the callback.
In this case the OnAudioFilterRead callback of script OAFR was first attached to a component of type AudioListener on the game object after which another component of type AudioListener tried to attach it.
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) {code}
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- var VisionOSEDRHeadromm has a comma instead of a dot when building with Metal Rendering App Mode and local OS localization is set to German
- IAP Catalog remove product “x” and add product “+” buttons are not consistent with other remove and add buttons in the Editor
- Performance issues in Play Mode when quickly hovering the mouse cursor over Hierarchy GameObjects
- Frame Debugger displays incorrect output when FidelityFX Super Resolution or Spatial-Temporal Upscaler is used with Temporal Anti-aliasing or Subpixel Morphological Anti-aliasing
- The layout system is failing to correctly calculate or apply the height of the Japanese fallback font when the primary English font's metrics are used
Resolution Note (fix version 6000.0.4f1):
Fixed a bug that would cause the editor to crash if you delete and then re-add an audio listener component.
Resolution Note (fix version 2022.3.32f1):
Fixed a bug that would cause the editor to crash if you delete and then re-add an audio listener component.
Resolution Note (fix version 2021.3.40f1):
Fixed a bug that would cause the editor to crash if you delete and then re-add an audio listener component.