SpawnSoundAtLocation vs PlaySoundAtLocation

So following the lecture and got to the part where adding sound to impact. Like SpawnSoundAttached, I went and tried SpawnSoundAtLocation and used exact stuff as in SpawnEmitterAtLocation, obviously changing emitter to my sound. It all worked great.

I couldn’t tell the difference between SpawnSoundAtLocation and PlaySoundAtLocation. Is there a difference? Is there a reason to not use the Spawn one?

SpawnSound[…] will create an audio component on which to play the sound which it will return allowing you to interact with it.

PlaySound[…] doesn’t create an audio component and uses the audio device for the world and returns void.

So use Play if you want to fire and forget.

So Spawn sound will eventually eat all your memory.

No, they would be garbage collected.

Privacy & Terms