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 EasyAR->Scenes folder & load the SingleObjectSelection scene.

  • Step 2 : Under the Canvas, a Panel has been added with singleObjectSelectionButton 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).

  • Step 3: Drag and drop your preferred created prefab (asmentionedin Section 6) from the EasyAR->Prefabs folder to this None(Game Object) area.

  • 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

You can add any number of singleObjectSelectionButton prefabs as you need in this scene

  • 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 EasyAR->Scenes folder respectively.

  • Step 7: Select your desired platform &build.(Refer 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.

  • Step 3 : Select AR Session Origin & go to inspector. Add MultipleObjectPlacement script from EasyAR->Scripts folder. Also add ARPlaneManager component to AR Session Origin gameobject.

  • Step 4 : For a pointer indicator you can add the pointer prefab from the EasyAR->Prefabs 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.

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 EasyAR->Prefabs folder.

  • Step 6 : Select AR Camera under AR Session Origin gameobject & Change the Tag of the AR Camera as Main Camera

  • Step 7 : Add ARSceneHandler prefab from EasyAR->Prefabs folder to hierarchy.

  • Step8 : If you don’t need a back button you can hide it.

    • Select back button from hierarchy.

  • Untick the game object from the inspector.

  • Step 9 : In hierarchy go to newly created Canvas & Add new panel. Add prefabChoosingButton prefab from EasyAR->Prefabs->Buttons as a child object in the panel.

  • Step 10: This one PrefabChoosingButton prefab is responsible for showing one AR object. You can add multiple PrefabChoosingButton prefabs as you need as a child object of the panel. Click PrefabChoosingButton & go to the inspector.

  • 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.

  • Step 12: Select MultipleObjectPlacement 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.

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 Single Object Placement)

  • Step 13 : Navigate to Canvas again in hierarchy. Add a notification panel as a child of canvas. You can find the notification panel prefab from the EasyAR->Prefabs 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.

  • 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)

Things you need to consider before building the project.

  • Make sure AR camera tag name set as Main camera

  • Make sure you add the notification panel & tag name is set as

    NotificationPanel.

  • Make sure all spawning objects prefabs include relevant gameobjects discussed in step 7-10 in section Single Object Placement.

  • Make sure all spawning objects include colliders

Last updated