# Network Instantiate

Uses Photon engine to instantiate object on network scene.

{% hint style="warning" %}
In order for it to work, it is necessary that the scenes have a gameobject with [**Photon View**](#photon-view) component.

The created prefab must be located in the *Resources* folder and have a **PhotonView** component. Also, if there is a need to install a parent for this object, there must be a **NetworkObjectInstance** component on it.
{% endhint %}

***

To create it, right-click on free space in Behaviour Tree window and select:&#x20;

* <mark style="color:purple;">**Create Node/Tasks/Integrations/Photon/Network Instantiate**</mark>

This task node has a number of fields, that are highlighted in picture below.

<figure><img src="https://2203000093-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGOxTM7Aj9oiVaIINrEkE%2Fuploads%2Fm9WFHmU3t0nQ5MpRpqdx%2FPhotonInstantiate.png?alt=media&#x26;token=7e9c3dac-b699-497e-a110-bb9202d1a926" alt=""><figcaption><p>Network Instantiate node</p></figcaption></figure>

### Fields

<table><thead><tr><th width="374">Name</th><th>Description</th></tr></thead><tbody><tr><td>Node Name</td><td>Custom name of node.</td></tr><tr><td>Ignore Abort Self</td><td>Whether node ignores abort self or not.</td></tr><tr><td>Object To Instantiate</td><td>Object reference to instantiate it.</td></tr><tr><td>Position</td><td>Instantiate position.</td></tr><tr><td>Rotation</td><td>Instantiate rotation.</td></tr><tr><td>Parent</td><td>Instantiate object as child of.</td></tr></tbody></table>

{% hint style="warning" %}
Using the parent property, when creating an object on the server, starts a search on the scene by the name of the parent object, using the [**GameObject.Find(name)**](https://docs.unity3d.com/ScriptReference/GameObject.Find.html) function. Which can negatively affect performance.
{% endhint %}

***

## Photon View

Required componet for Photon Engine instantiate node.

<figure><img src="https://2203000093-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGOxTM7Aj9oiVaIINrEkE%2Fuploads%2Fd2G87uAq7rOSRNmmLS51%2FPhotonView.png?alt=media&#x26;token=14a8a06a-e2f8-4970-85b0-18e74a866b35" alt=""><figcaption></figcaption></figure>
