# Setting up a custom scene

### How to set up a single object placement

This will guide you how to add a single object with easy manipulation (rotation/scaling/change position with shadow) into your project.

* **Step1** : Go to the <mark style="color:yellow;">EasyAR->Scenes</mark> folder & load the **SingleObjectSelection** scene.

![](https://1413926957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgATWbsXiFJ9V1pG3RP0K%2Fuploads%2F7CCZCeep5JDbiVikt0VP%2Fimage-031.png?alt=media\&token=9255d4a0-2ad9-4007-921d-681b872e380d)

* **Step 2** : Under the Canvas, a Panel has been added with <mark style="color:yellow;">singleObjectSelectionButton</mark> prefab. Select this prefab and in the inspector you would see an empty field in the Button component OnClick() event named as **None(Game Object)**.

![](https://1413926957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgATWbsXiFJ9V1pG3RP0K%2Fuploads%2Fvcjq4dLR4Q4FsIebGqfe%2Fimage-032.png?alt=media\&token=f819cfcc-30d8-4489-95e1-1e57f281b00a)

* **Step 3**: Drag and drop your preferred created prefab (asmentionedin Section 6) from the <mark style="color:yellow;">EasyAR->Prefabs</mark> folder to this **None(Game Object)** area.
* &#x20;**Step 4**: At the same time you can drag and drop the relevant materials of the prefab you created to the **Object Materials** in the **Prefab Material Handler** script.
* **Step 5**: If needed, you can change the sprite of the button prefab with a preferred relevant name

![](https://1413926957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgATWbsXiFJ9V1pG3RP0K%2Fuploads%2FL4Rh5cLNirfiPz7NcGei%2Fimage-033.png?alt=media\&token=5cefe0f7-cf35-403b-96a7-8fb4eb25d561)

{% hint style="warning" %}
You can add any number of **singleObjectSelectionButton** prefabs as you need in this scene
{% endhint %}

* **Step6** : Now you are ready to build the scene with your custom prefab. Go to build setting and remove all the scenes under scenes in the **Build Settings**. Then set the first scene as your **SingleObjectSelection** scene (the scene which is created now) & ARSingleObject scene from the <mark style="color:yellow;">EasyAR->Scenes</mark> folder respectively.

![](https://1413926957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgATWbsXiFJ9V1pG3RP0K%2Fuploads%2F5AbF8u5hB55GhnhTZ4CM%2Fimage-034.png?alt=media\&token=c2e87e18-8e5d-48f5-9466-47f6d006b557)

* **Step 7**: Select your desired platform \&build.(Refer [Build the application](https://render-island.gitbook.io/easy-ar/fundamentals/build-the-application) section to change the build setting according to the platform you choose). Enjoy the Easy AR app.

### How to set up the Multiple Object Placement

In this section, we will guide you to how to create **ARMultipleObjectScene**.

* **Step 1** : Create a new scene and name it as “**ARMultipleObjectScene**”or any preferred name.
* **Step 2** : Delete Main camera from scene and Add AR Session, AR Session Origin from right click on the hierarchy and goto XR then select AR Session and AR Session Origin.

![](https://1413926957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgATWbsXiFJ9V1pG3RP0K%2Fuploads%2FVRh467Kk9rLzKXW13obR%2Fimage-035.png?alt=media\&token=412b7ebd-1710-4823-ba85-e4a20cd2eb99)

* **Step 3** : Select AR Session Origin & go to inspector. Add **MultipleObjectPlacement** script from <mark style="color:yellow;">EasyAR->Scripts</mark> folder. Also add **ARPlaneManager** component to AR Session Origin gameobject.

![](https://1413926957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgATWbsXiFJ9V1pG3RP0K%2Fuploads%2FsovXf11oROqu7DAt80Cs%2Fimage-036.png?alt=media\&token=f5644b7b-4541-4401-8451-c8dd520aa7be)

* **Step 4** : For a pointer indicator you can add the **pointer prefab** from the <mark style="color:yellow;">EasyAR->Prefabs</mark> folder. For Canvas you need to create a new canvas in game hierarchy and drag & drop in to the **Canvas** game object in Multiple Object Placement component.

![](https://1413926957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgATWbsXiFJ9V1pG3RP0K%2Fuploads%2FPOSxQcbsvh7kcZ0BHy5b%2Fimage-037.png?alt=media\&token=e4ebb9e3-733f-4465-90a3-2f2de06a24f0)

**Step 5** : Also you need to add **AR Environment Probe Manager** component to **AR Session Origin** gameobject. For debug prefab drag and drop **AREnvironmentProbe** prefab from <mark style="color:yellow;">EasyAR->Prefabs</mark> folder.

![](https://1413926957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgATWbsXiFJ9V1pG3RP0K%2Fuploads%2Ff7kRggQ7Wk6HDDM00gGW%2Fimage-038.png?alt=media\&token=e26702cd-ffbc-4217-aae9-d2d1068033f2)

* **Step 6 :** Select **AR Camera** under AR Session Origin gameobject & Change the <mark style="color:yellow;">Tag</mark> of the <mark style="color:yellow;">AR Camera</mark> as <mark style="color:yellow;">Main Camera</mark>

![](https://1413926957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgATWbsXiFJ9V1pG3RP0K%2Fuploads%2F8fR8TD5Gyck1IDPYGNLc%2Fimage-039.png?alt=media\&token=abf1c840-9315-430b-8f30-210d94aea077)

* **Step 7** : Add **ARSceneHandler** prefab from <mark style="color:yellow;">EasyAR->Prefabs</mark> folder to hierarchy.

![](https://1413926957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgATWbsXiFJ9V1pG3RP0K%2Fuploads%2F5lR14J2YWupo2ZC3R6R7%2Fimage-040.png?alt=media\&token=b5c6bf70-786a-421a-936c-04cd473f43c7)

* **Step8** : If you don’t need a back button you can hide it.&#x20;
  * Select back button from hierarchy.

![](https://1413926957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgATWbsXiFJ9V1pG3RP0K%2Fuploads%2FMdj9TXP0chREzXSxftyr%2Fimage-041.png?alt=media\&token=713cfc99-af65-46fd-853c-07e350a0312c)

* Untick the game object from the inspector.

![](https://1413926957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgATWbsXiFJ9V1pG3RP0K%2Fuploads%2FIlYoB4ERmbcFkLfr6Duv%2Fimage-042.png?alt=media\&token=1c27f6cb-d2ba-42a5-b870-c735158c049b)

* **Step 9** : In hierarchy go to newly created Canvas & Add new panel. Add **prefabChoosingButton** prefab from <mark style="color:yellow;">EasyAR->Prefabs->Buttons</mark> as a child object in the panel.

![](https://1413926957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgATWbsXiFJ9V1pG3RP0K%2Fuploads%2F0C7gt3bd3M6TXMv8jdGG%2Fimage-043.png?alt=media\&token=8f076fde-bdc2-4ebc-b3b0-0ef19ddff1db)

* **Step 10**: This one **PrefabChoosingButton** prefab is responsible for showing one AR object. You can add multiple <mark style="color:yellow;">PrefabChoosingButton</mark> prefabs as you need as a child object of the panel. Click <mark style="color:yellow;">PrefabChoosingButton</mark> & go to the inspector.

![](https://1413926957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgATWbsXiFJ9V1pG3RP0K%2Fuploads%2FedC5I8uXN5zmwmcLcYlx%2Fimage-044.png?alt=media\&token=cb208c35-8f7b-434c-89bb-ea96d0b8895f)

* **Step 11** : Under the **Onclick** function it has already added Settings gameobject. Remove it & Add new -> drag & drop **AR Session Origin** game object from Hierarchy.

![](https://1413926957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgATWbsXiFJ9V1pG3RP0K%2Fuploads%2F6AC6wJomrG0MfUMnMJRV%2Fimage-045.png?alt=media\&token=cbe1f8c6-6d27-4b94-9313-d949fe4c2613)

* **Step 12**: Select <mark style="color:yellow;">MultipleObjectPlacement</mark> script & spawnObject method. You can drag & drop the game object prefab that you need to spawn here. Same time you can add a number of prefab materials & add materials to list in Prefab Material Handler Script.

{% hint style="warning" %} <mark style="color:orange;">Make sure when you create a Spawning object prefab should follow the same steps in steps followed at single object placement developed. (Refer step 7-10 in section</mark> [<mark style="color:orange;">Single Object Placement</mark>](https://render-island.gitbook.io/easy-ar/demos/single-object-placement)<mark style="color:orange;">)</mark>
{% endhint %}

![](https://1413926957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgATWbsXiFJ9V1pG3RP0K%2Fuploads%2F4l6D3mXmUNqmFA7X4QpR%2Fimage-048.png?alt=media\&token=7352b603-58ca-435a-954b-af5a67b49aa0)

* **Step 13** : Navigate to Canvas again in hierarchy. Add a <mark style="color:yellow;">notification panel</mark> as a child of canvas. You can find the <mark style="color:yellow;">notification panel</mark> prefab from the <mark style="color:yellow;">EasyAR->Prefabs</mark> folder. This panel is responsible for showing error messages if a user tries to place a vertical placement object in Horizontal planes or horizontal placement objects placed in a vertical plane.

![](https://1413926957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgATWbsXiFJ9V1pG3RP0K%2Fuploads%2FdZAz68MPzn85GymHMdCM%2Fimage-049.png?alt=media\&token=a46261dd-d98f-44cc-ac16-4f42333b7115)

* **Step 14** : Yes you are reaching to the final step. Go to the **build setting** & choose your preferred platform & build. (Add the scene to build settings if the scene is not in build setting)

{% hint style="warning" %} <mark style="color:orange;">Things you need to consider before building the project.</mark>

* <mark style="color:orange;">Make sure</mark> <mark style="color:orange;"></mark><mark style="color:orange;">**AR camera**</mark> <mark style="color:orange;"></mark><mark style="color:orange;">tag name set as</mark> <mark style="color:orange;"></mark><mark style="color:orange;">**Main camera**</mark>
* <mark style="color:orange;">Make sure you add the</mark> <mark style="color:orange;"></mark><mark style="color:orange;">**notification panel**</mark> <mark style="color:orange;"></mark><mark style="color:orange;">& tag name is set as</mark>

  <mark style="color:orange;">**NotificationPanel.**</mark>
* <mark style="color:orange;">Make sure all spawning objects prefabs include relevant gameobjects discussed in step 7-10 in section</mark> [<mark style="color:orange;">Single Object Placement</mark>](https://render-island.gitbook.io/easy-ar/demos/single-object-placement)<mark style="color:orange;">.</mark>
* <mark style="color:orange;">Make sure all spawning objects include colliders</mark>
  {% endhint %}
