Hello Guest

Author Topic: Calling SFX with Animation Triggers  (Read 3426 times)

Kirb

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 36
    • View Profile
Calling SFX with Animation Triggers
« 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.
« Last Edit: February 10, 2014, 05:52:00 pm by Kirb »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Calling SFX with Animation Triggers
« Reply #1 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.