decentraland / sdk

PM repository for SDK
Apache License 2.0
4 stars 4 forks source link

Use playSound() in smart items #1092

Closed nearnshaw closed 5 months ago

nearnshaw commented 6 months ago

When using the Play Sound action in a smart item, we're currently using the old method of setting the playing property of the AudioSource to true.

This has the problem that if I try to retrigger the sound before it finishes, I can't.

We should instead use the new AudioSource.playSound() function, which handles retriggers.

https://docs.decentraland.org/creator/development-guide/sdk7/sounds/#play-sounds