ap
New Member
Posts: 22
Posts: 22
|
Post by ap on Jul 17, 2015 22:05:35 GMT
I am a little confused.
When I create a Group in MA, in the Hierarchy there is a Unity audio source component as a child of the group. This is why I am confused...if I click on that component and look for it in my scene, it's nowhere near the place where the sound is meant to come from.
Am I meant to move the audio source component i.e change its transform or am I meant to make it a child of the object where the sound is meant to come from or do I leave it where it is?
I don't understand the physical relationship between the MA sounds (i.e. Groups) and the Unity sounds (i.e. Audio Source components).....i.e audio source distance in MA is confusing!
Thanks
|
|
|
Post by DarkTonic Dev on Jul 18, 2015 3:20:16 GMT
It sounds like you were checking the location in edit mode, not while Playing.
Leave it where it is. It does not matter *where* that Sound Group Variation game object is in the Scene. Whenever you tell the Sound Group to play, its position will change to the position of the game object "making" the sound. If you told it to follow the game object, its position will be updated every frame while its playing. The Variations follow game objects (they never re-parent) but stay in the Hierarchy under the Master Audio game object always. Reparenting would be nice as it would avoid "follow code" but it creates unfixable errors when objects get destroyed (the Variation also gets destroyed).
If you have more questions, let me know.
|
|
ap
New Member
Posts: 22
Posts: 22
|
Post by ap on Jul 18, 2015 8:25:35 GMT
OK I'm nearly there... Whenever you tell the Sound Group to play, its position will change to the position of the game object "making" the sound. If you told it to follow the game object, its position will be updated every frame while its playing. But what is the position of the the game object "making" the sound? ...where is the "making" happening!? Is it derived from the trigger script? e.g. I make a cube and attach an EventSound 'On Trigger Enter' to it, to fire a Group. When it triggers the position of the sound will be where the cube is? And all the Unity 3D sound settings...max and min distance and the graph of distance/volume....do they still apply? Sorry I'm a bit new to this and can't quite conceptually understand..though what you said is clear except for this point. Thanks! EDIT: I think I understand..if I look at the volume/distance graph in Play mode, I'm moving away from my sounds until I trigger them..then they suddenly jump to where the Audio Listener is.....so I think I am right...they move to where the Trigger script is? Do the 3D settings still take effect when the sound 'moves' to the listener location?
|
|
|
Post by DarkTonic Dev on Jul 18, 2015 18:10:28 GMT
Correct, they move to where the trigger script is (its Transform position), whether that's EventSounds, provided Playmaker Custom Actions or a script you are writing with code like:
MasterAudio.PlaySound3DFollowTransform("Arrow", 1f, this.transform);
The 3d settings min/max distance are relative to the position the Variation / Audio Source is at. Even if it is constantly moving around. So yes.
|
|
ap
New Member
Posts: 22
Posts: 22
|
Post by ap on Jul 18, 2015 22:31:38 GMT
Groovy, got it, brilliant, thanks!
|
|
|
Post by DarkTonic Dev on Jul 19, 2015 2:35:36 GMT
No problem.
|
|