Quantcast
Viewing all articles
Browse latest Browse all 81

2 audio sources on a game object, how use script to instruct one to play?

If I have an empty game object with two audio sources, each with a unique audio clip.

How, in script, do I pick one from the other? Let's say one audio source has a audio clip called jump.mp3 and the other has grunt.mp3

is it something like

var grunt : Audio Source; grunt = audio source with grunt.mp3

And then use grunt to talk to that one?

Or is there a way that a script attached to the game object with the two audio sources can directly talk to a chosen audio source without having to assign a variable?


Viewing all articles
Browse latest Browse all 81

Trending Articles