GetComponent<Animator> in Update

Since this animation update is going to happen every frame for (presumably) the rest of the game, I’m wondering what the tradeoffs are between this approach and caching the Animator in Start() or as a SerializedField.

Why do we get the component on every frame? Is there an advantage to doing it this way over caching and viceversa?

Thanks

2 Likes

No, in this case caching it is a good idea. And we will be doing that a little later in the course.

Thanks!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms