Turning animation while player presses button.

All right, let’s go with some super simple/silly questions:

I have this GameObject. This gameObject has an animator attached to it. It performs several things like making the gameObject spawn, despawn, and all that stuff.

In the middle of all of this, I have a “Idle” animation that keeps the object centered and with its original scale. The reasons behind the need of this animation are [still unknown to me][1].

My problem here is that I need to make the GameObject rotate when (and while) a user presses a button, and then make the object maintain that animation when the user stops pushing the button. So, I need to either:

  1. Get how can I set the initial transform of a animation to a specific value.

  2. Learn how to make the initial transform of a given animation be the current transform of the GameObject.

Maybe there’s something wrong with my “idle animation approach” (as it fixes the idle state to a specific transform), but I haven’t managed to get why or how.
[1]: Behavior of empty state machines and idle (empty) animations - Questions & Answers - Unity Discussions

Have you tried to parent the animated game object to an empty game object - and control the “turn” of that empty game object without having to mess with the original game objects animation parameters?

As long as the original game object is not being translated (moved) in space - I think this is the setup I would use. Also I don’t think I would control spawn/de-spawn in the animator - but if it works for you - keep it. :slight_smile: