|
Post by matiasmanzano on Nov 17, 2015 19:43:17 GMT
So I’ve been testing Master Audio with Unity 5.2 F1 and even though I’ve figured out how to do most of the music and ambiences implementation, I haven’t been able to implement sound in a couple of game objects that react to user inputs (controller).
Basically I have a match -3 type of game that needs to trigger sound whenever you move the gem object or when you make the match you get the typical “blast”. So for my “gem” prefabs I have the following components: Transform, 2D Rigidbody , 2D collider and a custom made script for the behavior.
I’ve tried using the event sounds component but it doesn’t seem to work, so if you can help me figure out how to trigger sound for this situation I would really appreciate it. Thanks again Matias.
|
|
|
Post by DarkTonic Dev on Nov 18, 2015 0:12:09 GMT
That sounds like something other than a MonoBehaviour event so you'll need to code it yourself. Fire the audio from your custom made script with a line like:
MasterAudio.PlaySound("SoundGroupName");
|
|
|
Post by matiasmanzano on Nov 18, 2015 14:35:17 GMT
Thanks! I'll code it in and let you know how it goes.
|
|
|
Post by DarkTonic Dev on Nov 18, 2015 16:21:19 GMT
Sounds good.
|
|