Closed RebeccaBieleskiWeta closed 7 months ago
@RebeccaBieleskiWeta - Is there a small project you can share with your issues?
We are not able to repro this on our end. The only suggestion I have is to visualize the position of the AudioListener and make sure the position matches your expectation and is occlusion output. Unity probably complains if you have multiple AudioListener so I am ruling that out as an issue.
Hi there! Thanks for the quick reply.
I can put together an example, I can't show in our project for NDA reasons. I've checked and ensured the audiolistener is where it's meant to be. The test rock music I'm testing with is perfectly occluded when it's on the camera. When it's on our character (I should say it's a third-person game), it just doesn't occlude.
Thanks. If you are able to put together a standalone repro, I can take a look.
Sure thing! I think this likely be something with how I've set it up in my project, some setting I've not understood. I'll make a new repo and project, replicate it and then link that project here. Edit: I recall, last time I was looking at SteamAudio to see how it would work with our project, the version I installed there came with a test example scene?
Alright, so I build a basic Unity project, implemented SteamAudio, and occlusion was working perfectly there. Attached to the character, only occluded when raytrace from source to listener is blocked. Within our own project, I've only been able to get the occlusion to work in 2 of two objects I have within my test scene, and only via sticking the source directly into the asset's wall. I'm looking at a way to extract the details from our project without breaking NDA.
Hi @achandak, I found the cause of the problem.
Within our game, the Player was being instantiated after the Steam Audio Manager was being created, meaning that line 46 in UnityAudioEngineState.cs would blindly search our scene with "var audioListener = GameObject.FindObjectOfType
In order to get it to work with out (although we will need to do some changes to ensure it is grabbing the correct audiolistener on our character), we run NotifyAudioListenerChanged() in SteamAudioManager once our Player has been instantiated.
Ah! Well done. We will add some notes in our documentation, as this might be reasonably common use case.
System Information Please provide the following information about your system:
Issue Description This might just be a problem from how I've set it up, but I'm using SteamAudio to drive our occlusion. When the audiolistener is on the camera, my ambience source is correctly occluded via some SteamAudio Geometry. However, when the audiolistener is on our character, the ambience source is never occluded.
Steps To Reproduce Steps to reproduce the behavior: