• RuntimesUnity
  • Can I play the audio the animator put in Spine somehow in Unity?

So, we have a skeleton in Spine with various "audio events", as you can see in the picture.

However, when I import the skeleton in Unity, the events do not show up.

I know I can play sounds if I use "standard Spine events" and then add an Audio Source with a sound attached in the scene. My main concerns are:

A) Is there any way I can import the skeleton with the sounds included so that Unity plays them automatically when the animation is played?

B) Even if A is not possible, should the "audio events" be shown in Unity so I could subscribe to them? Or Unity only imports "standard events"?

  • Misaki ha risposto a questo messaggio
    Related Discussions
    ...

    Glitched_Bug Perhaps you have a misconception about audio events. Audio events simply store: the path to an audio file, volume and stereo balance values used to play the audio file. Just setting them does not automatically play the audio during animation playback.

    You can find an example script HandleEventWithAudioExample.cs to play a sound triggered by a user defined event in an example scene comes with the spine-unity package: Spine Examples/Getting Started/2 Controlling Animation

    Yeah, I was hoping there was a way t¡in which I wouldn't need to attach the audio file directly to the Audio Source.

    However got the audio to play at the time of the event thanks to this, so thank you!

    • Misaki ha risposto a questo messaggio
    • Misaki ha messo mi piace.

      Glitched_Bug I'm glad to hear that you can now play the audio. Thank you for getting back to us!