# Clones

> Learn about clones and cloning in Babylon.js.

Source: https://doc.babylonjs.com/features/featuresDeepDive/mesh/copies/clones

## Clone
This creates a deep copy of the original mesh and saves memory by sharing the geometry. Each clone can have its own material and transformation. Operations that manipulate the vertex data will be applied to all shared geometries. If you need to make independent changes to a clone's geometry, you must call a method like ```clone.makeGeometryUnique()```, which will disconnect the shared geometry and allow you to treat the clone as its own mesh/geometry.

```javascript
const box1 = BABYLON.MeshBuilder.CreateBox("box1", {height: 1, width: 0.75, depth: 0.25, updatable: true});
const box2 = box1.clone("box2");
box1.position.x = -1;
box2.position.x = 1;
```


Note that as of v5.0, cloning a mesh with a skeleton will assign that skeleton to the clone, i.e., the skeleton is shared. If your clone does not need a skeleton, simply set it to null.
```javascript
clone.skeleton = null;
```
Alternatively, if your clone needs a skeleton, simply clone the source mesh's skeleton.
```javascript
clone.skeleton = mesh.skeleton.clone();
```

## Examples
[Playground: Cloning Example 1](https://playground.babylonjs.com/#QMFPPE) - Simple example showing shared geometry by scaling one geometry by 2. Shows shared geometry by scaling one geometry by 2.  

``` ```
[Playground: Cloning Example 2](https://playground.babylonjs.com/#QMFPPE#1) - Simple example showing transformation by scaling of 2 only changes one mesh. Shows transformation by scaling of 2 only changes one mesh.  

``` ```
[Playground: Cloning Example 3](https://playground.babylonjs.com/#QMFPPE#2) - Simple example of clones with different materials. Different materials.
