Using Animation Events instead of a Timer?

Hey!

I haven’t quite finished the course just yet but I have noticed that the animation stuff so far has been timer based which can lead to logic being triggered at the wrong time during an animation.

I did some research to solve this issue and came across Unity’s animation events and how they can trigger logic at a specified time during the animation.

Is there a reason these aren’t being used for this course?

1 Like

Yup Animation Events are an excellent way to handle timing in the animation itself.
As to why I didn’t use them, it’s because I like to keep the Visuals and Logic as separate as possible.
The more you keep those separate the easier it is to understand the code. If you start mixing visuals and animation events along with logic everything starts to become really confusing.
But yes in technical terms that does work, you just need a script attached to the same object as the Animator and you can call functions on that script from any animation.

2 Likes

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

Privacy & Terms