Help with an Animation in 2d

Hey there…

This may be a simple question, but I do not know where to look…

I have an animation (10 images) at a set speed…
I would like to know if is possible to add it to an object (i.e. Main Camera) at runtime, so I can set its speed at 0 when needed…

What I am trying to do, basically, is to have the animation playing, then, at a random time it gets “paused” (speed 0), something else comes to the screen for a little while, then it goes away and the animation resumes until it finishes…

I know how to do all that… but to add the animation 2d to an object at runtime… is it possible? Where can I look / learn how to do it?

Thanks a lot!!!

Either add an Animator component from the start and enable/disable it as needed. That should be the fastest way to do it. However, if you really want to add a component use: Unity - Scripting API: GameObject.AddComponent.