I created a Prefab called White Letter and added an Animator to it to create the illusion of falling letters.
I use this Prefab to generate words; here's an animated gif of what it looks like in action:
The animation basically turns the Mesh Renderer On and Enables the Audio Source, and then dynamically alters the Font Size and Offset over 30 frames to make it look like it's falling:
I took each of the White Letters (and the dot) and put them into a List of GameObjects. Then "For Each" GameObject on the List, I triggered the animation.
The problem I'm running into is that at first, all of the animations ran at the same time. So to get around that, I added a "Wait for 1 second" to the end of my For Each loop.
This worked but is not elegant and doesn't offer fine-grained control over the animation timings.
Ideally I would like to have better control over the animation timing. For example, I'd like the X to fall... and then at a certain frame of its fall, I'd like to trigger the animation for the next letter (the dot). Etcetera.
Basically while the Animator of one GameObject is executing, I'd like to be able to trigger the Animator of the next GameObject (in my list).
Any advice on how to achieve this?
WaitForSeconds
to be a fraction of your animation length. Where do you need help achieving that? \$\endgroup\$