bevyengine / bevyengine/bevy

Macro for spawning related entities can't be used with `SpawnableList`

Open
#20,455 0 comments 2 reactions 0 assignees View on GitHub
A-ECS C-Feature C-Usability D-Macros S-Needs-Design
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?

The `children!` macro is convenient, but it can’t be used with `SpawnableList`s. So if I need to use `SpawnWith` or `SpawnIter`, I have to fall back to `Children::spawn`, which isn’t very ergonomic.\

This design affects other crates too. For example, in BEI, the only way to represent presets is by using `SpawnableList` - and those can't be used with the related macro either:

```rust
Bindings::spawn((Spawn(Binding::mouse_motion()), Axial::right_stick()))
```

## What solution would you like?

The perfect solution would be to either adjust the macro or somehow change the design to avoid requiring the use of `Spawn` for `RelationshipTarget::spawn`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.