So, to play a function you need to call it like this
SoundEffect() do this everytime they type
YES!
THANK YOU SO MUCH I HAVE SPENT ALL DAY! You are a genius xD
The article never says how game.Debris is better, or that Destroy() uses an old remove method, it’s basically saying use both methods sparingly depending on the situation, game.Debris is for destroying objects with a limited lifetime, and Destroy() for instantaneous removal. In my use case Destroy() was appropriate because there wasn’t a reason to yield also I’m pretty sure game.Debris calls the Destroy() methods on objects internally
I don’t want to debate, in this thread but so you know, when you use wait it pauses the whole script, when you use delay it makes a new thread, you don’t want that, it will also cause and error if the sound was already destroy, so game.Debris should be used if a object has a lifetime, which a sound object doesn’t really need but it’s a better habit to start using game.Debris.
re-read my code, there’s no need for any kind of yielding or lifetime, PlayOnRemove allows you to destroy the sound object instantaneously and still have playback
I’m just saying you delete out the part where I said the sound object doesn’t need a lifetime…