Hi everybody,
I'm actually experimenting with sound effects... It's the first time of my whole gamedev journey that I'm actually adding sound to a game.
I was probably naive to think that if I create a "loot" sound effect and play it every time my player loot an item, that it will play exactly the number of time that it was requested...
So I've done that and when my player run across multiple items the sound effects play once for 5 looted items. I mean, the sound have to be completely played to be played again.
Does someone have a idea to overlap sound effects or something similar that is more reactive ?
Thanks in advance.
Regards,
[SOLVED] Question about love.audio
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- ChicoGameDev
- Citizen
- Posts: 70
- Joined: Thu Feb 14, 2019 6:02 pm
- Location: Switzerland
- Contact:
[SOLVED] Question about love.audio
Last edited by ChicoGameDev on Wed Mar 18, 2020 11:36 am, edited 1 time in total.
- zorg
- Party member
- Posts: 3444
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Question about love.audio
As you said, one Source object can only play one instance of a sound at once; you can either rewind and start the source again, or you can use Source:clone to clone a Source, and play that when another instance of the same sound needs to be played while another's still playing. It might also be a good idea to save these into a table or something so you don't create too much garbage.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
- ChicoGameDev
- Citizen
- Posts: 70
- Joined: Thu Feb 14, 2019 6:02 pm
- Location: Switzerland
- Contact:
Re: Question about love.audio
I understood that shortly after posting this question.
Thanks for the clone idea tho !
I made me a little function that check if the sound is already playing if it is the case it stop it to play it again, it's perfect.
Regards,
Thanks for the clone idea tho !
I made me a little function that check if the sound is already playing if it is the case it stop it to play it again, it's perfect.
Regards,
Who is online
Users browsing this forum: Ahrefs [Bot] and 207 guests