Skip to main content

duplicate

Function duplicate 

Source
pub fn duplicate(world: &mut World, reg: &Registry, e: Entity) -> Entity
Expand description

Deep-copies registered components of a non-transient subtree. The copy is a sibling of the original; only the root gets a (Copy) suffix. Runtime-only components are omitted and name-based references are not remapped. Traversal terminates even for malformed cyclic input hierarchies.

ยงPanics

Panics when e is stale. The destination world must register every copied type.