Thursday, 3 May 2012

Scripting sounds...

I added the sounds into the animation scripts to trigger when the animations are played. Here is the script broken down:

This var is needed so the file can be selected in the Inspector window in Unity.

'audio.Play();' shows the audio being played inside the update that triggers the animation.
'audio.clip = swing;' sets the current sound that the 'Audio Source' plays. This allows all of the sounds to use the same audio source. The 'AudioSource' is shown attached under the collisions script, both attached to Gutsy.





No comments:

Post a Comment