|
Post by looneyjetman on Jun 12, 2021 21:41:25 GMT
I've had a great first day with Master Audio, setting up music in my prototype game, along with synchronised music tracks too.
However, I've hit a bit of a wall when it comes to sound effects. I've generated a few basic effects and configured them for things like pitch variation. Whilst my sounds are playing they all sound mono. I'm still a relative beginner with Unity so I might be missing something really basic.
Initially I was triggering my sounds with this line of code:
MasterAudio.PlaySound("EnemyExplosion"); After a bit of reading I tried this instead, with transform.position being the position of the enemy unit:
MasterAudio.PlaySound3DAtVector3("EnemyExplosion", transform.position);
This still plays the sound, but the positioning doesn't sound any different.
If I force everything to 3D I get no sounds. I also tried removing the Audio Listener from the camera and placing it on the Player object, however when I did this the audio faded as soon as I moved from the initial position. I might be missing something really obvious in the documentation, but any help would be greatly appreciated.
|
|
|
Post by DarkTonic Dev on Jun 13, 2021 19:17:40 GMT
Sounding mono usually just means you're in 2D.
When you switched to 3D you got no sounds - That means the Audio Source Template you're using has a Max Distance too small for your game. Everything is too far away to be heard by your Audio Listener. You will need to apply larger and larger Audio Source Templates (in the Master Audio mixer section) to all your Sound Groups until you can hear the sounds at the volumes you want. You can also make your own Audio Source Templates if those included aren't ideal for you.
-Brian
|
|
|
Post by looneyjetman on Jun 14, 2021 15:34:20 GMT
Thank you for the assistance. I've made all my audio sources larger now and can hear them in the correct position. Am I right in assuming that the PlaySound3DAtVector3 is the correct way to be playing the sounds?
|
|
|
Post by DarkTonic Dev on Jun 14, 2021 16:04:42 GMT
AtVector3 is a more rare use for things that don't have a physical position, such as 2.5d games. Normally you'll use PlaySound3DAtTransform or if the object moves then PlaySound3DFollowTransform.
-B
|
|
moat
New Member
Posts: 4
Posts: 4
|
Post by moat on Jun 18, 2021 22:52:29 GMT
I added versions of these methods that included rotation parameters so that I could influence sound directionality.
Sound directionality is the phenomenon where the volume of a sound is projected in a non-uniform pattern depending on the direction of the emitter.
It's useful for situations where roaring monsters have directional sound emitters attached to their heads and are turning their heads while emitting sounds, for rotating speakers, or even for firearms and cannons that project their sounds more strongly downrange.
|
|
|
Post by DarkTonic Dev on Jun 19, 2021 1:20:48 GMT
That might be useful, please send me your code additions and I will see if we can roll it into the product.
-B
|
|