Character Navigation

Navigate by getting directions from a 3D character

Overview

The Character Navigation scene contains all the assets added to the map in the ARWAY Web Studio within the Developer Portal.

It contains the following major components -

  • MapsManager (Script)

  • AssetImporter (Script)

  • NavController (Script)

  • AStar (Script)

  • Character Nav Controller (Script)

  • ARSpace (Gameobject)

Maps Manager Script:

The MapsManager.cs script is responsible for loading all the maps when the user starts the scene. After the user selects a map, he can then navigate through the selected map by choosing a destination.

Maps Manager (Script)

Asset Importer Script:

The AssetImporter.cs script imports all the assets into the scene once the page is loaded. The main components in the Content scene are:

  • Waypoints

  • Destinations

  • Images

  • Texts

  • 3D asset

  • Floor plan images

Asset Importer (Script)

NavController and AStar Script:

In order to navigate from the user's current location to the selected destination, NavController.cs and AStar.cs scripts are being used.

You can change the navigation path UI by dragging a new prefab onto the navigation path prefab item.

Also, you can choose whether to show the path during runtime or not via the Show Path toggle.

Expand the Path item see the shortest path to the selected destination from the user's current location i.e. the AR Camera.

For navigation to work, waypoints need to be added "from the origin to the destination at regular intervals" within the Floor Builder page in the Developer Portal.

NavController, AStar (Script)

Character Nav Controller Script:

The CharacterNavController.cs script takes a 3D character as input and is responsible for navigating the user to the selected destination. The character also intelligently waits for the user if they stop following it.

Character Nav Controller (Script)

What is ARSpace?

ARSpace is a gameobject present in the Unity scene hierarchy, that localizes any content placed under it as a child to the localized origin (0, 0, 0).

So, in order to display assets during runtime in the built application, the assets must be made a child of the ARSpace gameobject.

ARSpace

How to add content to ARSpace?

In order to add content to ARSpace, simply drag and drop the assets as a child gameobject to the ARSpace gameobject.

By default there is a Gizmo gameobject as a child of ARSpace, which shows the localized origin in the scene during runtime.

How to Use?

Step 1: Open the Character Navigation scene found in the Assets/ARWAYSDK/Scenes folder within the Unity project.

Step 2: In the Hierarchy window, look for ARWAYSDK gameobject and then click on it.

Step 3: In the Inspector panel, look for Arway SDK Script and enter your unique Developer Token in the Developer Token field and save the scene.

ARWAY SDK (Script)

Step 4: After saving, add the current scene along to the build settings. Then choose the platform of your choice (Android/iOS) and build the application.

Step 5: Install the built app on your device and open it.

Step 6: Upon opening the app, you will see a list of Maps created on the ARWAY web studio. Choose the one corresponding to your location.

List of Maps created in Developer Portal

List of all the created maps in the ARWAY Web Studio. In order to learn how to create a map using the Web Studio, click on the link below.

Step 7: After choosing a Map, select the destination where you want to go from the Select Destination dropdown at the top.

Step 8: After choosing the destination, the selected 3D character will take the user to their selected destination.

Character Navigation Demo