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

Ability for one off spatial sounds #72

Closed
BrianWiz opened this issue Mar 6, 2024 · 5 comments
Closed

Ability for one off spatial sounds #72

BrianWiz opened this issue Mar 6, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@BrianWiz
Copy link
Contributor

BrianWiz commented Mar 6, 2024

It would be nice to play a spatial sound from any location without necessarily having to attach it to an entity.

So for example, I have a shotgun with some reverb, I want it playing from the location of the shot, not attached to the weapon entity, because I don't want the sound following the weapon around (my game is fast, you'd notice it).

It seems that right now I would have to create an entity, attach a SpatialAudioBundle to it, track it's playback state, then delete the entity.

@GitGhillie GitGhillie added the enhancement New feature or request label Mar 6, 2024
@GitGhillie
Copy link
Collaborator

GitGhillie commented Mar 6, 2024

The velocity of the sound would always be 0 in such cases right? If that's the case I think there is a nice way to implement this

@BrianWiz
Copy link
Contributor Author

BrianWiz commented Mar 7, 2024

@GitGhillie that is correct yep

@GitGhillie
Copy link
Collaborator

Made a PR if you want to give your thoughts on it ^

@Salzian
Copy link
Owner

Salzian commented Mar 8, 2024

With the current implementation, attaching an AudioSource to an entity ensures that the sample data is loaded and ready when you try to play it. We basically attach the lifetime of FMOD objects to bevy entities, which overall should result in a more predicate behavior.

I suggest creating entities with a Transform and AudioSource and create a function that sets the new position and plays the audio simultaneously.

Please let me know if you had anything different in mind and want to explore this problem further.

@Salzian Salzian closed this as not planned Won't fix, can't repro, duplicate, stale Mar 8, 2024
@BrianWiz
Copy link
Contributor Author

BrianWiz commented Mar 8, 2024

That's an interesting suggestion, will try that out!

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

Successfully merging a pull request may close this issue.

3 participants