So I have a panel, and I have a button. I want it so that when I click the button the panel slides in from the left, and when I click the button again, it slides back out of frame. I already have two animations for the panel sliding in and out. How can I accomplish this?
You have to add a bool that stores whether the panel is open or closed. When the button is clicked, you check the bool. If the panel is closed, you play the ‘in’ animation and when it’s open, you play the ‘out’ animation.