#1351·entt

Request to add this interface(create new entity by cloning): auto cloned = registry.clone(entity)

Author: krishna116Created Sep 9, 2026Updated Sep 9, 2026

This might be a commonly used interface—for example, when implementing particle or spell effects, where new particles are generated based on existing ones—so I’m requesting that this interface be added:

cpp
/**
 * @brief Create new engity by cloning another entity.
 * @param target The entity to be cloned.
 * @return Cloned entity.
 */
[[nodiscard]] entity_type clone(const entity_type target){
    if(!contains(target)) return entt::null;
    if(!valid(target)) return target;
    
    auto cloned = create();
    for(auto &&curr : storage()) {  
      if(auto &storage = curr.second; storage.contains(target)) {  
        storage.push(cloned, storage.value(target));  
      }  
    }
    
    return cloned;
}