spawn_batch doesnt return the spawned entities
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 161
Description
## What problem does this solve or what need does it fill?
When I call commands.spawn(...) I get the entity back. I would expect to get a list of entities when I spawn_batch.
Not providing this forces me to bend over backwards if I need the entities. Any solution I have found is terrible for performance and has high complexity. Even if I write a custom impl for Command, it still requires a world lock which should be unnecessary.
## What solution would you like?
commands.spawn_batch() -> Vec
## What alternative(s) have you considered?
Inserting a tag and then have another system pull the tagged entities (bad for performance and sloppy)
Writing custom Command (hard, overkill, adds complication needlessly)
Writing exclusive system (world lock slows everything else down)
Also all of the above force the spawning to be delayed, causing race conditions and other nonsense.
The docs claim all spawn_batch does is pre-allocate and use iterators. If that is true, returning the entities should be very possible and easy.
Contributor guide
Assessment
This issue has not been assessed yet.