Jump to content

Audio Area : 2D Dimension and Output type behaviour


ranch000
Go to solution Solved by ranch000,

Recommended Posts

Hi. To give some context before asking my query,  I am working on an isometric (2.5D) game where the user can only pan the (orthographic) camera in X and Y directions. I need to play respective audio (with stereo panning) when the user pans the camera over certain terrain elements. Since it is an isometric game, various terrain elements are placed at different Z to handle proper rendering.

I have an audio area set up as shown in attachment. The 2D dimension and Z direction works as expected when output type "Straight" is chosen. i.e. Irrespective of the Z difference between audio area and Camera, the audio is heard. However, In order to achieve the the stereo Panning effect I would require setting the Output type as "Local Position". But with this setup, audio seems to drop off with increasing Z distance between Camera and Audio Area (though dimension is 2D). Please let me know how I may go about this

Thanks and Regards

Audio Area Config.png

Edited by ranch000
Link to comment
Share on other sites

On 1/26/2022 at 10:13 PM, ranch000 said:

Hey, any update on this?

Sorry for the late response this took some time to look into: 

It's possible the AudioListener and the AmbienceManager are on separate objects with "Auto Move Manager" off which might cause this to happen.

Alternatively, you could move the AudioListener and the AmbienceManager onto an object other than the camera and move that as needed (though this shouldn't be needed)

To farther diagnose the issues, is it possible to get a screenshot of the settings of the "Ambience Manager" and/or to check that the values displayed on the "Monitor" are correct

image.jpegimage.jpeg

I.E. moving the camera along the Z axis shouldn't affect the levels of the area or sequences set to 2-D with axis set to Z

Link to comment
Share on other sites

On 1/28/2022 at 4:07 PM, Bryan said:

move the AudioListener and the AmbienceManager onto an object other than the camera and move that as needed

Due to my game being isometric, this is unfortunately not an option for me, as different audio areas will have different Z when the camera is panned.



The fade levels in monitor are unaffected with Z but the actual audio is.

AmbientManager.png

Link to comment
Share on other sites

The system is playing the audio at full volume from the AudioSource object that is being placed on the AudioArea. As the camera moves away from it, it is fading because of the distance from the AudioSource. 

There are 2 solutions that should potentially work for your use case: 
1. Change the "Output Type" from "Local Position" to "Player Position" on the Audio Area. 
image.png

This will make it place the AudioSource on the Camera instead of the Area and it should fade correctly. 

2. Create an AudioSource prefab to set as the "Output Prefab" and set it's "3D Sound Settings" to start fading out at a distance higher than the camera would go away from it: 
image.png

Option 1 is the easiest but if it breaks something else in their game, then it might be easier to create an updated prefab that won't fade with the distance to the camera.

You will need to make sure that the Sequence's "Follow Position" value is true

I noticed a slight oversight that the Sequence's "Follow Position" value is always used instead of the AudioArea's

Link to comment
Share on other sites

17 hours ago, ranch000 said:

Due to my game being isometric, this is unfortunately not an option for me, as different audio areas will have different Z when the camera is panned.



The fade levels in monitor are unaffected with Z but the actual audio is.

AmbientManager.png

^

 

Link to comment
Share on other sites

11 hours ago, Bryan said:

As the camera moves away from it, it is fading because of the distance from the AudioSource. 

But shouldn't the distance have no effect on audio since the dimension is set to 2D and direction to Z?

11 hours ago, Bryan said:

Change the "Output Type" from "Local Position" to "Player Position" on the Audio Area

Tried this but it doesn't give the stereo pan effect as in "Local Position"

I will try messing around with the 2nd approach you've suggested

Link to comment
Share on other sites

10 hours ago, ranch000 said:

But shouldn't the distance have no effect on audio since the dimension is set to 2D and direction to Z?

Tried this but it doesn't give the stereo pan effect as in "Local Position"

I will try messing around with the 2nd approach you've suggested

Please let me know how it goes 

 

Link to comment
Share on other sites

  • Solution

Was able to achieve what I wanted by decoupling the audio area from terrain objects and placing the audio area at same Z as camera

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
  • Need help?

    We work with some of the biggest brands in global gaming, automotive, technology, and government to create environments, games, simulations, and product launches for desktop, mobile, and VR.

    Our unique expertise and technology enable us to deliver solutions that look and run better at a fraction of the time and cost of a typical project.

    Check out some of our non-NDA work in the Gallery, and then Contact Us to accelerate your next project!

×
×
  • Create New...