Search Issue Tracker
Audio starts playing from the beginning when Undo/Redo Audio Source changes in Play Mode
* Download the "Terrible Tweeters - Audio.zip" project and open it in Unity;
* Open the "Level1" scene;
* Select the "Music" gameObject in the Hierarchy;
* Enter Play mode;
* Observe that the Audio starts playing;
* In the "Music" gameObject Audio Source modify the Volume Slider;
* Observe that the Volume of the Audio decreases
* Undo your change
Expected result: Audio Volume restores to the previous value and Audio continues playing;
Actual result: Audio Volume restores to the previous value and Audio starts playing from the beginning;
* This issue happens with Redo too;
Reproducible in Unity 2022.1.0a12, 2022.1.22f1, 2022.2.0b14, and 2023.1.0a18
Not reproducible in Unity 2022.1.0a11
Regression in Unity 2022.1.0a12
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- IL2CPP Player crashes when there aren't enough Thread Static Slots
- Articulation Body tree changes behavior after attaching a trigger Collider
- Fatal freeze when playing a VFX made with VFX Graph and consisting many effects
- "Failed to download Build.data.br file" error is thrown when building projects for WebGL with the Compression Format set to "Brotli"
- Documentation Link does not work when the "New Panel Settings" question mark is clicked
The undo system changed behavior in 2022.1 in that it now activates and deactivates game objects. Undo basically takes a backup of the objects before and after a change. Since the backup can potentially reorder the transform hierarchy, it is necessary to deactivate before backup restoration, then activate again.
This change was necessary to fix a large class of undo bugs. Worst cases were ones where subtle changes were introduced in the scene causing the scene files to include bad data, causing a crash the next time you would load the scene. If the user was able to figure out what was happening and be able to revert the scene in version control then great, only a few hours of work would be lost. Worst case, users would have to redo the entire scene
It is also the exact behavior as what happens when changes to a prefab is applied to an instance in the scene, so it is more aligned to other functionality in the Unity editor.
So, restoring the previous behavior for audio only would misalign with the general behavior across the engine.