Skip to content

Create a Landmarks compatible Environment from scratch

Michael Starrett Ambrose, PhD edited this page Oct 20, 2023 · 44 revisions

Watch Video Tutorials

Create a new environment from scratch (click to open or right-click and open in a new tab/window): Alt Text Here -Or- Video Tutorial (click to open or right-click and open in a new tab/window): Alt Text Here

Objective: Recreate the SimpleSample_50x50.unity scene from a New Scene using only the Unity Editor

  1. From the Unity editor window, select File > New Scene

  2. Delete everything from the scene's hierarchy (Main Camera and Directional Light)

  3. Drag and drop the _Landmarks_ prefab (Assets/Landmarks/Prefabs/) into the hierarchy

  4. Locate the LM_Environment GameObject, a child of our new _Landmarks_ GameObject, and expand it to view children. Note: MapTestPlaceHolders is no longer used.

  5. Populate the environment with filler props

    • Right-click on the existing filler_props GameObject. Select "Create Empty" and rename this new child of filler_props to "NonTargetProps"

      • Right click our new NonTargetProps GameObject and select "3D Object > Cube"

        • Click on our new Cube GameObject and, under the Transform component, set the Position (-12.5, 5, 13.8) and Scale (5, 10, 5)
      • Right click the Cube object we just created and select "Duplicate" (repeat this process until there are 5 copies)

      • In the inspector, under Transform, set the Position of each cube GameObject (functionally, these GameObjects can be located anywhere in the environment)

      • In the project window, navigate to the material you want to apply then drag and drop it onto each cube that we just created

    • Right click the filler_props GameObject. Select "Create Empty" and rename this new child of filler_props to "Walls"

      • Right click our new Walls GameObject, select "3D Object > Cube", and change the name of this GameObject to "C"

        • In the inspector window, set the values for the Transform component of the C GameObject

        • In the project window, navigate to the material you want to apply then drag and drop it onto the GameObject that we just created

      • Right click the Walls GameObject again, select "3D Object > Cube", and change the name of this GameObject to "M"

        • In the inspector window, set the values for the Transform component of the M GameObject

        • In the project window, navigate to the material you want to apply then drag and drop it onto the GameObject that we just created

      • Right click the Walls GameObject again, select "3D Object > Cube", and change the name of this GameObject to "Y"

        • In the inspector window, set the values for the Transform component of the Y GameObject

        • In the project window, navigate to the material you want to apply then drag and drop it onto the GameObject that we just created

      • Right click the Walls GameObject again, select "3D Object > Cube", and change the name of this GameObject to "K"

        • In the inspector window, set the values for the Transform component of the K GameObject

        • In the project window, navigate to the material you want to apply then drag and drop it onto the GameObject that we just created

    • Right click the filler_props GameObject. Select "3D Object > Cube" and rename this new child of filler_props to "terrain"

      • In the inspector window, set the values for the Transform component of the terrain GameObject

      • In the project window, navigate to the material you want to apply then drag and drop it onto the terrain GameObject we just created.

  6. Create target objects for navigation and other tasks

    • Right-click on the existing TargetObjects GameObject, select "3D Object > Sphere", and rename this new child "Red Sphere"

      • In the inspector window, set the values for the Transform component of the Red Sphere GameObject

      • In the project window, navigate to the material you want to apply then drag and drop it onto the Red Sphere GameObject in the hierarchy.

    • Right-click on the existing TargetObjects GameObject, select "3D Object > Capsule", and rename this new child "Blue Capsule"

      • In the inspector window, set the values for the Transform component of the Blue Capsule GameObject

      • In the project window, navigate to the material you want to apply then drag and drop it onto the Blue Capsule GameObject in the hierarchy.

    • Right-click on the existing TargetObjects GameObject, select "3D Object > Cylinder", and rename this new child "Green Cylinder"

      • In the inspector window, set the values for the Transform component of the Green Cylinder GameObject

      • In the project window, navigate to the material you want to apply then drag and drop it onto the Green Cylinder GameObject in the hierarchy.

    • To randomly populate targets at startup: Use the transforms provided above, set the TargetObjects parent GameObject's transform to be outside the environment (x: 0, y: 0, z: 700), and move on to the next step.

    • To set persistent startup locations for each target: Adjust the transform so that each target object is at the desired location (e.g., the ones shown for the TargetLocations in step 7) and skip step 7 (i.e., do not create any child objects of TargetLocations).

  7. Specify the possible locations for target objects within the environment (for random population of targets at startup only).

    • NOTE: There may be more child objects of TargetObjects than of `TargetLocations,' but the reverse is not allowed (i.e., # of child objects in TargetObjects >= # of child objects in TargetLocations).

    • Right click on the TargetLocations GameObject and select "Create Empty". Repeat this process two more times so that there are three children of TargetLocations. Rename these GameObjects, "Target01", "Target02", and "Target03", respectively. Use the following values for the Transform component of each object.

  8. Specify locations in the environment where the player will be spawned (i.e., starting locations)

    • Right click on the NavigationStartingLocations GameObject and select "Create Empty". Repeat this process two more times so that there are three children of NavigationStartingLocations (one for each child of TargetObjects). Rename these GameObjects, "StartLoc01", "StartLoc02", and "StartLoc03", respectively. Use the following values for the Transform component of each object.

Congratulations! You have just created your first Landmarks-compatible scene! If you hit play in the Unity Editor, you will be able to see the pre-configured welcome and goodbye instruction messages. You can follow the same steps in this tutorial to create your own unique Landmarks-compatible environment. You can also practice more with this environment by checking out our tutorial on adding tasks to an existing, Landmarks-compatible scene/environment.