2D Toolkit Forum
2D Toolkit => Support => Topic started by: Kirb on February 10, 2014, 05:46:29 pm
-
Hello,
Might there be any example or reference scripts floating around regarding playing sound files on specific frames of an animation? (Using the animation triggers?)
I'm an absolutely abysmal scripter, so any sort of example would help; couldn't really find a similar thread on the forum.
-
The Anim Sprite sample (tk2dDemoAnimController) has an example that pops up a message box on an animation trigger. Once you hook into the animation trigger, you can play a sound in any way you normally do it in Unity - eg. AudioSource.PlayClipAtPoint( clip, transform.position, 1); where clip is an AudioClip you drag a reference to.