Ralith / hecs

A handy ECS
Apache License 2.0
967 stars 82 forks source link

Duplicate Entites #256

Closed PandaCommando closed 6 months ago

PandaCommando commented 2 years ago

It would be nice if it was possible to make a unique duplicate of an entity, making copies of its components. The function could look like World::duplicate(&mut self, entity: Entity) -> Entity It could return the id of the copied entity. Currently(if I'm not mistaken), I don't think there is an easy way to do this.

Ralith commented 2 years ago

This is impossible, because components are not required to be Clone. Consider keeping around an EntityBuilderClone yourself that you can use as needed.