> For the complete documentation index, see [llms.txt](https://docs.coherence.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coherence.io/manual/asset-management/instantiate-via.md).

# Instantiate via

In coherence, it is possible to specify how a Prefab is instantiated at runtime using the **Instantiate via** option on the CoherenceSync component.

## Built-in instantiators

We support three implementations out of the box: Default, Pool or DestroyCoherenceSync, but you can also [create your own](#creating-your-own-instantiator).

### Default

This instantiator will create a new instance of your Prefab, and when the related network entity is destroyed, this Prefab instance will also be destroyed.

### Pool

This instantiator supports **object pooling**, instead of always creating and destroying instances, the pool instantiator will attempt to reuse existing instances. It has two options:

* **Max Size**: maximum size of the pool for this Prefab, instances that exceed the limit of the pool will be destroyed when returned.
* **Initial Size**: coherence will create this amount of instances on app startup.

### DestroyCoherenceSync

This instantiator will create a new instance for your Prefab, but instead of completely destroying the object when the related network entity is destroyed, it will destroy or disable the CoherenceSync component instead.

## Creating your own instantiator

You can implement the `INetworkObjectInstantiator` interface to create your custom implementations that will be used by coherence when it needs to instantiate a Prefab in the scene.

Custom implementations can be `Serializable` and have their own custom serialized data.

To begin, use the dropdown menu on the CoherenceSync and use the **Create Implementation...** option:

<figure><img src="/files/cj68x6116zTdxm6pRwiG" alt="" width="563"><figcaption><p>Selecting a instantiator or creating your own</p></figcaption></figure>

Let coherence generate the scripts for you, and customise them as you see fit.

Once created, implementations of this interface will appear in the **Instantiate via** dropdown shown above, or in the corresponding CoherenceSyncObject asset.

See [Instantiating from CoherenceSyncConfig](/manual/asset-management/using-coherencesyncconfig-to-instantiate-gameobjects.md) for two examples of object instantiation using indirect (using `CoherenceSyncConfig`) and direct (using `CoherenceSync`) references.
