Ben said in this lecture that we could use code as we did to animate the windmill or use an animator. Which would be better in terms of performance? is there even a difference?
Animators are better in most ways to using code to animate an object.
There are limitations; for example, to ‘animation motion to a specific location’ animator can’t easily be used (some things are possible using IK targets, but mostly only for humanoid animation).
However, for something like this the animator is both more performant and easier to control.
You can also use StateMachineBehaviour to script events at particular animation states; significantly better than trying to use a MonoBehaviour and trying to detect the current state, or using some kind of ridiculous custom state machine.
Unity has some very skilled engineers working on optimizing the code for their most commonly used and robust features like lighting, animation, physX, etc. Plus, their code doesn’t have to be translated from C#. As a general guideline, I’d bet on the code for their key features to be more optimized than anything I would ever come up with on my own.
That being said, if it’s not unreasonable, I’d much rather do things by code.