2D Toolkit Forum

2D Toolkit => Support => Topic started by: Kirb on February 10, 2014, 05:46:29 pm

Title: Calling SFX with Animation Triggers
Post 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.
Title: Re: Calling SFX with Animation Triggers
Post by: unikronsoftware on February 11, 2014, 09:50:41 am
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.