Bevy's bundle types should implement Clone where possible #12985
Labels
A-Cross-Cutting
Impacts the entire engine
A-ECS
Entities, components, systems, and events
C-Usability
A targeted quality-of-life change that makes Bevy easier to use
What problem does this solve or what need does it fill?
When working with a collection of prefab entities (aka a zoo or manifest), it can be very useful to store a canonical bundle for each kind of object, and then clone it to initialize a new entity of that kind.
Unfortunately, not all of Bevy's bundle types implement Clone. I ran into this with
TextBundle
, but I'm sure there's more.What solution would you like?
Derive
Clone
on all of Bevy's bundle types where possible. Add trivialClone
impls to all contained components.What alternative(s) have you considered?
This can be worked around by implementing a custom bundle type which either mirrors or embeds Bevy's bundle types, and implementing Clone on that.
Additional context
#1515 covers a feature request to clone arbitrary entities, once they exist. This feature request is distinct but related: rather than cloning entities dynamically, we simply want to clone the set of data used to generate them.
The text was updated successfully, but these errors were encountered: