Hello I really could use some help with this.
I have a button where on press it plays an animation (when pressed the button that I pressed slides out, like a custom slider) So once the button is pressed the button moves to another part of the screen, how can I press the button again and it returns to its original position?
Thank you! Really could use some help with this!
Create two Animations for the button. One to take it from wherever it is to where you want it to be and then the second from the second position or wherever back to the default location.
Create animations by going to the animation while selecting the button gameobject.
Then through a script. Play the animation you want.
`
// Plays the default animation
animation.Play();
// Plays the walk animation - stops all other animations in the same layer
animation.Play("walk");
// Plays the walk animation - stops all other animations
animation.Play("walk", PlayMode.StopAll);
`