-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Description
What problem does this solve or what need does it fill?
Currently when trying to clone components into an existing entity the methods available are
commands.entity(entity)
.clone_components::<Bundle>(other_entity)
.clone_with_opt_in(other_entity, |_| {})
.clone_with_opt_out(other_entity, |_| {});However when trying to clone components into a new entity the methods available are
commands.entity(entity)
.clone_and_spawn()
.clone_and_spawn_with_opt_in(|_| {})
.clone_and_spawn_with_opt_out(|_| {});Cloning components into an already existing is missing an equivalent to clone_and_spawn, and spawning a new entity and cloning components into it is missing an equivalent to clone_components.
What solution would you like?
Change clone_components to clone all components and add a clone_bundle that only clones the components in the bundle.
Add a clone_bundle_and_spawn method for spawning an entity with the cloned components in the bundle.
What alternative(s) have you considered?
Use the already existing clone_(and_spawn)_with_opt_* methods to cover the missing space, however these methods are quite low level and may be confusing for newcomers
Metadata
Metadata
Assignees
Labels
Type
Projects
Status