move_components

Function move_components 

Source
pub fn move_components<B>(target: Entity) -> impl EntityCommand
where B: Bundle,
Expand description

An EntityCommand moves the specified components of this entity into another entity.

Components with Ignore clone behavior will not be moved, while components that have a Custom clone behavior will be cloned using it and then removed from the source entity. All other components will be moved without any other special handling.

Note that this will trigger on_remove hooks/observers on this entity and on_insert/on_add hooks/observers on the target entity.

ยงPanics

The command will panic when applied if the target entity does not exist.