Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request/question] Is there a way to export scene static or dynamic geometry at runtime? #371

Open
GurtTractor opened this issue Sep 12, 2024 · 2 comments

Comments

@GurtTractor
Copy link

Hello, I'm working on a Unity project that uses Steam Audio, and I'm thinking about adding a user generated content feature where players can import their own maps into the game and play in them. I'd really like reflections and reverberation to work for those maps just as it will for my pre-made maps, but I'm not sure if this is possible because to get Steam Audio working currently requires clicking a menu item in the Unity editor.

I can get the Steam Audio geometry components to be automatically added once the maps are imported, but I'm not sure how or if it would be possible to get Steam Audio to export the scene geometry at runtime so that I get acoustic reflections and reverberation.

Is the Steam Audio Dynamic Object the way to do this perhaps? I noticed that the manual mentions that you can attach them to prefabs, but I guess the prefab has to be pre-existing in the project folder and already exported to a .asset file for this to work?

@lakulish
Copy link
Collaborator

@GurtTractor You should be able to call the same function that the menu item calls to export scene geometry:

You could call this function right after adding all the necessary Steam Audio Geometry components to the user-generated content. This would result in a .asset file being created, which you will have to bundle with the rest of the content. Because the Steam Audio Static Mesh component that gets added to the scene will contain a reference to this .asset file, it should automatically get bundled by Unity's AssetBundle feature.

Of course, not knowing how your specific UGC feature is intended to work, some of the above may not be applicable, or may need some tweaking.

@GurtTractor
Copy link
Author

I'll give that a try soon, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants