Animating A Physical Button Game Object

Im trying to make a physical in world button that is depressed when you click it. I have already made the code for it and that works fine. What im having trouble with is the animation. I have never animated before so this is a first.
The problem is i have made an animation that is just a keyframe of the button being depressed and then released shortly after. Except i want to be able to put this animation on any other button i want. But when i do this the button teleports back to where the animation was made. I understand the most common answer for this is to give the object a parent. But i dont want to do this, as i have already made all my models with buttons in place and i dont want to delete them all just to duplicate one button over and over so that the parent moves to a new location. Im not really sure what to do here so i would appreciate some help.

Hard to give decent insight as I cant see the project but on the button object make sure “Apply root motion” is unchecked in the Animator component

Sorry i forgot to reply to this thread, i ended up fixing this issue by animating the object through a script rather than a animation clip.

1 Like