I have a simple event system set up where when the player is in collision with the switch and the E button is pressed, to change the animation from “left” to “mid”. However, when I do this, the switch moves completely away from it’s original position.
It’s to do with the point of origin of the button. If you change it to the base of the button sprite (say bottom middle) it’ll be fine.
The sprite is placed at the same point for each animation. That sprite is made up of images. The position of the image in the animation relative to the origin will be different between animations. The image for unpressed will be lower than the image for pressed.
Also it might help if you make your animations the same size because I read their answers above but can’t understand why changing the animations would make it jump around like that. Unless maybe they’re different sizes. Or the same size but framed incorrectly.