playcanvas / playcanvas/engine
Feature request: sound.play() without a slot name to play the first slot
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 16.8k
- Forks
- 2k
- Avg merge
- 4h 32m
- Merged PRs (30d)
- 222
Description
I’m just flagging this again as a useful and sensible default bahaviour.
If someone does sound.play(), detect that the first parameter is undefined and just play the first sound attached - with a check to see if there is a sound there of course :slight_smile: - as this is very likely what a new, and experienced, dev would want most of the time.
Seems reasonable and I do like the simplicity on single slot sound components
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the sound.play() entry point and trace how the sound component handles its first argument and attached slots. Done means calling sound.play() without a slot name plays the first attached sound when one exists, while safely handling a component with no sound.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- audio-video-rtc, game-dev
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100