Search Issue Tracker
By Design
By Design in 2023.1.X
Votes
0
Found in
2022.1.0a12
2022.1.22f1
2022.2.0b14
2023.1.0a18
Issue ID
UUM-18551
Regression
Yes
Audio starts playing from the beginning when Undo/Redo Audio Source changes in Play Mode
To reproduce:
- 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;
Notes:
- 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
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
- Required SpriteMask class (ID 331) is stripped when "Strip Engine Code" is enabled
- “Maximized serialized file backup not found” error is thrown when minimizing a window in a newly opened project
- Build stack trace contains invalid lines when building with IL2CPP using scripts with delegates containing generic types in the signature
- Entities Systems window has a “Show Full Player Loop” dropdown which does nothing when clicked after enabling “Show Full Player Loop”
- Entities Hierarchy Search “Show/Hide” button’s Lens Icon is blurry when the Editor is on an external monitor
Resolution Note:
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.
Resolution Note (2023.1.X):
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.