Creating a new object prefab

Easy AR Spatial Anchors with Azure Cloud already included prefabs in the Easy AR Spatial Anchors ->Prefabs folder. All these prefabs are made in a specific structure. From this section we guide you to create an Easy Anchor specific prefab.

  • Step 1 : Create a new scene with a preferred name. Delete default main camera & directional light of scene.

  • Step 2 : Create an empty game object & name it as 3dmodel name itself. (for example we name it “Rocket”). Reset the transform of that game object.

  • Step3 : Drag & drop the 3D model into the hierarchy window as a child of the empty game object. (For example we select the Rocket 3d model). Reset the transform of the 3d model. The size of the 3D object can be changed as you desire.

  • Step 4 : Select empty game object which was created before & go to inspector. Add box collider to it & set size same as game object’s (Rocket) size. Also add SceneryItemPrefabDetails script from Easy AR Spatial Anchors ->Common->Scripts to it

In the SceneryItemPrefabDetails script, you can change the properties below according to the object.

  • Item Name - Place the same name appears in the empty gameObject which is script attached. (ex: Rocket)

  • Enable Rotation Feature - If this check, the user is able to rotate the object when placing.

  • Enable Scale Feature - If this check, the user is able to scale up or down the object, when placing

  • Rotate Factor - In which speed object should rotate (Default: 650)

  • Scale Factor - In which unit of scaling happen when object scaling

    (Default: 400)

  • Step 10: To create the prefab you can go to the Easy AR Spatial Anchors ->Prefabs folder and drag and drop the Empty parent object (Rocket) to this folder.

Last updated