'Unity animation changes position after repositioning or resizing sprite

I created a simple animation that changes the sprite's position x.

It works well, but when I reposition the sprite or resize the sprite using the editor, I see that the animation's position values were not changed, leading to the sprite to jump over to the previous position.

Here's a snapshot of the animation's keyframes, showing that the starting position is 0.

enter image description here

After I move the sprite around the scence, these value remain 0, and when the animation starts, the sprite moves back to position 0,0,0.

Is there any way to set the animation's position values relative? or make it change automatically when I change the sprite's position?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source