> For the complete documentation index, see [llms.txt](https://render-island.gitbook.io/easy-ar/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://render-island.gitbook.io/easy-ar/guides/how-to-create-a-new-object-prefab.md).

# How to create a new object prefab

Easy AR already included prefabs in the <mark style="color:yellow;">EasyAR->Prefabs</mark> folder. All these prefabs are made in a specific structure. From this section we guide you to create your own 3d object prefab.

* **Step 1** : Create a new scene named “PrefabBuilder” or desired name you need in <mark style="color:yellow;">EasyAR -> Scenes</mark> folder & load the scene.

![](https://1413926957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgATWbsXiFJ9V1pG3RP0K%2Fuploads%2FusM3J1AJkJ5JJ0v8sXsA%2Fimage-024.png?alt=media\&token=95af745a-ced6-4549-8a85-3b26a29cca71)

* **Step 2** : Delete Main Camera and Directional light from hierarchy.
* **Step 3** : Add the 3d object that you wish to create a prefab from EasyAR->Meshes folder. (for example we are going to make a prefab from our pitcher model )

![](https://1413926957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgATWbsXiFJ9V1pG3RP0K%2Fuploads%2FsA4XlLfAoAYGXOah8CO2%2Fimage-025.png?alt=media\&token=251d75f8-d27a-4a86-ba95-633546b4c536)

* **Step 4** : Create an empty game object & name it as 3D model name itself. (for example we name it “**pitcher**”). Reset the transform of that game object.

![](https://1413926957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgATWbsXiFJ9V1pG3RP0K%2Fuploads%2FhdqdOMfvIU3BW37ID9tl%2Fimage-026.png?alt=media\&token=4ada8e94-5aa1-490e-85b8-dc8e5238da69)

* **Step5** : Drag & drop the 3D model into the hierarchy window as a child of the empty game object. (For example we select the pitcher 3d model). Reset the transform of the 3d model. Sametime you can add the relevant materials to your object.

![](https://1413926957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgATWbsXiFJ9V1pG3RP0K%2Fuploads%2Fpnb6mCJlQZi2PURHdZZ8%2Fimage-027.png?alt=media\&token=b3866e18-adae-4140-8ec5-4b7b7ad647ea)

{% hint style="warning" %}
Please consider the size of the 3d object can be changed as you desire. Also if you create a vertical placement object make sure object face towards Y up direction
{% endhint %}

* **Step 6** : Select empty game object which was created before & go to inspector. Add box collider to it & set size same as game object’s (pitcher) size. Also add **SpawningObjectDetails** script from <mark style="color:yellow;">EasyAR->Common->Scripts</mark> to it.

![](https://1413926957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgATWbsXiFJ9V1pG3RP0K%2Fuploads%2FTcDxhDNK4LcEQgAGAOtW%2Fimage-028.png?alt=media\&token=56799158-5e31-4cb3-8dd7-d6817b7f6243)

* **Step 7** : Drag & drop the following game objects under the empty gameobject respectively as child objects.
  * Indicator prefab (<mark style="color:yellow;">EasyAR->Prefabs</mark>)
    * &#x20;Adjust the Indicator (position, rotation and scale)

      accordingly to the object vertical or horizontal placement.
  * WorldSpaceCanvasPrefab (<mark style="color:yellow;">EasyAR->Prefabs</mark>)
  * Shadow Plane Prefab (Goto [Shadow map generation](/easy-ar/guides/shadow-map-generation.md) to see how to generate the

    shadow plane)

![](https://1413926957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgATWbsXiFJ9V1pG3RP0K%2Fuploads%2FkSpEJXAwWDDd2e0bz1lJ%2Fimage-029.png?alt=media\&token=399e2fff-b0d4-49c4-90aa-5fe6c8fe5141)

* **Step 8** : Select Empty object (**pitcher**) & go to Inspector. Under the <mark style="color:yellow;">SpawningObjectDetails</mark> script you have to drag & drop below three prefabs accordingly.
  * For **Shadow Plane**, drag & drop <mark style="color:yellow;">gameobject’s shadow prefab</mark> (pitcher shadow) from hierarchy.
  * For **Touch Indicator**, drag & drop <mark style="color:yellow;">Indicator prefab</mark> from hierarchy.
  * For **Scale Percentage Indicator**, drag & drop the <mark style="color:yellow;">WorldSpaceCanvas</mark> prefab from hierarchy.

![](https://1413926957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgATWbsXiFJ9V1pG3RP0K%2Fuploads%2F5wE8x8BrppKkyJsR3ehk%2Fimage-030.png?alt=media\&token=aced69ad-2a38-492e-bc8a-088211cde2ab)

* **Step 9**: Set the <mark style="color:yellow;">plane detection mode</mark> in the <mark style="color:yellow;">Spawning object details</mark> component into Vertical or Horizontal. (Do not set it as Everything)
* **Step 10**: To create the prefab you can go to the <mark style="color:yellow;">Easy AR->Prefabs</mark> folder and drag and drop the Empty object (pitcher) to this folder.

You are done...Now you have created your own prefab to be spawned.
