Unity animations - Is the animation component really deprecated?

I was looking for a way to create simple transform animations for 2d objects. As example, I wanted to animate all the objects of the scene when the game is paused (i.e. I just want to move the objects outside the screen boundaries with a nice animation). I think that creating an Animator Controller for something like this is not really useful for two reasons:

1. I don't know where the objects are at runtime. Please correct me if I'm wrong, I think I cannot dynamically change the value of a keyframe attached to an animation controller, so if I just start a transform animation the sprite will jump at the first keyframe value and then performs the animation. Terrible result.

2. If I have 200 objects I should create 200 animation controllers with 200 animations.

Creating animation programmatically would be great, but I read on forums and here on stackexchange that you cannot dynamically handle keyframes... and that I HAVE to use the Animation Controller, otherwise I can use the Legacy animation system (that to me sounds so... deprecated :P)

They talk about the "Animation" component... and they don't say this element is Legacy/Deprecated. Looking at this page it seems that I have a lot of control over Animation actually... but know I'm completely confused! Is this component deprecated or not? Should I always use the Animation Controller instead?

• I think Animation component is not deprecated as if it is so, then official documentation must mentioned that there. Also as an alternative, you can use iTween – Hamza Hasan Feb 29 '16 at 6:54
• But if you attach an "animation" to a GameObject automatically you get an animation controller.... What does that mean? :/ And if you attach the animation through the "add component" button, you have to mark the animation as legacy. – MatterGoal Feb 29 '16 at 7:03
• 1- Because Animator Controller controls the Animations. 2- I was not that in, in Animation component. But the definition Legecy is, the component or element that is deprecated but the most useful element and still popular among users. – Hamza Hasan Feb 29 '16 at 7:13
• GameObjects can share animation controllers so you wouldn't need 200 of them necessarily. I'm not too sure what you mean by your first point - you can trigger a transition in your animation controller, start playing the animation and program the object to move upwards... What's the problem? – zcabjro Feb 29 '16 at 10:51
• @Jack the problem is that if I want to animate the position of the object let's say from 10,10 to 30,30 I should have an object already placed in 10,10 otherwise, as soon as the animation starts the object will jump to 10,10 from its current position. An example of usage: during the game play I have 10 objects moving randomly around the screen, when I pause the game I want these objects to move to an arbitrary position x,y. I cannot perform these animations using the animation controller... and this is a shame since there I might easily adopt animation curves. – MatterGoal Feb 29 '16 at 21:06

I would accomplish it by adding an Animator component and an animation clip I wanted to play for the duration of the motion (e.g. a helicopter flying off would play an appropriate animation clip where the blades spin faster or the helicopter angles itself and so on).

I would then code the movement itself with a simple script or by allowing an existing movement script to do it.

private bool animateExit = false;

private void Update()
{
if(animateExit)
{
}
}

public void AnimateExit()
{
// plays the exit animation
GetComponent<Animator>().SetBool("exit", true);
animateExit = true;
}

// handles the movement
private void AdjustPosition(float x, float y)
{
transform.position += new Vector3(x, y, 0f) * Time.deltaTime;
}


To use old animation component click on your model and set animation to legacy then remove any animation controllers from it and add and animation component. Yeah I think in your case it will be better but check out animation override controller , its use when objects have same animations and you dont have to make same controllers again and again .