Steps to replicate:
- Create a cube on the scene
- Change cube X scale to from 1 to 2; the cube changes size accordingly
- Move the cube some way to the left on the X axis
- Press Ctrl+Z
Expected behavior: cube goes back to its original position along the X axis
Actual behavior: cube scales back to 1 but stays where it is
To put it simply, most of the time Unity tries to undo not the actual last action, but some action that happened before that. Some changes (like, in my example, moving the cube) can never be undone at all.
How to deal with this problem?