May 31, 2022
Note: This tutorial includes visuals of the old UI. Updates follows soon.
In this VR Builder tutorial, you will learn how to use the Workflow Editor, a graphical user interface of VR Builder, to define processes for your VR application in Unity. In detail, you will learn how to work with steps, transitions, and chapters in the Workflow Editor.
Before getting started, you need to set up the scene for using VR Builder. Please refer to the VR Builder setup guide for additional help. For this tutorial, we will use an empty Unity scene.
After setup, the Workflow Editor automatically appears in a new window and displays an empty process. It contains a single chapter Chapter 1 and only the Start node. Every chapter has its own Start node. The Start node defines where the process begins for each chapter.
We recommend adding it to a wide area on the bottom, for instance, together with the Unity tabs Project and Console:
n case you closed the Workflow Editor and want to open it again, you can find the option to Open Workflow Editor from the VR Builder tab in Tools.
It is also possible to create several VR Builder processes in a single Unity project. However, every scene should only use one of them. You can select the process for a given scene by selecting the Game Object [PROCESS_CONFIGURATION] in the Hierarchy and choosing the Selected Process in the Runtime Configurator (Script) in the Unity Inspector.
A process is described by a sequence of steps. Steps are connected with each other via transitions. A step can also have several transitions entering or exiting. This allows processes to be non-linear, as illustrated by the following example from the VR Builder demo scene.
You can structure your process with chapters. There is no technical necessity to use chapters but they can help you keep the overview over the process. Before going into detail about each of these topics, please note that the Workflow Editor supports undo and redo for all following functions. You can either click on Edit->Undo / Edit->Redo in Unity's menu bar or use the hot keys Ctrl+Z and Ctrl+Y.
To add a new step, right-click somewhere in the empty area of the Workflow Editor and select Add step from the flyout.
Note that another tab - the Step Inspector - will appear directly after a step is selected. The Step Inspector is covered in the next tutorial. For now, you don't need to worry about it, so you can just move it somewhere, where it does not bother you.
To delete a step, right-click on the step and select Delete. You can also press the delete key on your keyboard.
In the same context menu, you also have the options to copy and cut the selected step. Alternatively, the hot keys Ctrl+C and Ctrl+X work as well. To paste a step, right-click in an empty area where you want to paste the step, then select Paste step.
By using the hotkey Ctrl+V, you will paste the cached step. It is even possible to paste a step into a text editor, in which case you will see the technical representation of the step. This might be a helpful gimmick for developers for debugging or hacking purposes.
To rearrange a step, left-click on it and drag it to the desired position, then release. Transitions are automatically positioned and updated while rearranging, so you don't need to worry about them.
Transitions connect steps with one another. They always exit one step and usually lead to another step. If no consecutive step is selected, this transition will lead to the end of the chapter and in case this is the last chapter, the end of the whole process. If a consecutive step is selected, it will be entered when this transition is triggered. A transition is automatically triggered as soon as all its conditions are fulfilled. In a later section, you will learn more on how to define conditions for transitions as well and how they can be fulfilled.
For now, let's dig deeper into working with transitions and their connections.
To add a transition, click on the + icon on the bottom right of the step where you want to add the transition. This transition can exit the step and be connected to a consecutive step.
To delete a transition, left-click on the trash icon next to the transition you want to delete. Since there has to be at least one transition for every step, the last transition will not disappear when deleted, but it will be emptied and the connection will be removed.
To set a transition's connection, drag'n'drop a connection with a left click from an exit node to the entry node of a step or the step itself:
To remove a transition's connection, right-click on the connection line and select Delete.
To change a transition's connection, you can simply create a new one. The existing one will be removed since only one connection per transition is possible. To model alternative paths exiting a step, use several transitions with one connection each.
It is also possible to operate on several steps and transitions at the same time. To do so, first select everything you want to work on by drag-selecting them. You can add additional and remove selected elements by pressing Ctrl and clicking on or drag-selecting them.
Then, you can use all the operations you learned in this tutorial to be applied to all of them at once.
Chapters can be used to structure complex processes. As every chapter has its own, separate graph, splitting up your process into several chapters makes it possible to keep clarity when creating complex processes. In the next subsection we will share best practices on working with chapters.
We recommend creating one chapter for each self-contained topic, as well as the introduction and the outro. An example for using chapters to structure the workflow can be found in the cockpit training demo scene provided with the Interhaptics integration for VR Builder.
In this example, there are three main tasks: Preparation, which in this case refers to building up pressure, starting the right engine, and then repeating the steps for the left engine. By defining the chapters first, then the process, and finally the steps, we were able to reuse a lot of the Start engine chapters.
It is best to create the chapter structure early on since splitting a chapter in two involves a lot of manual work.
Next to the chapter, you find four icons. The first two are the up and down arrows. By clicking on them, you can move this chapter up and down one slot.
Note that chapters always follow a linear order. So, at the end of the first chapter, the second one automatically starts. At the end of the second chapter, the third one starts, and so on.
Next to the arrow icons, you have a trash bin icon for deleting the chapter and an edit icon which allows you to rename it. You can add new chapters by clicking on the + Add Chapter button on the bottom of the chapter list.
In this VR Builder tutorial you have learned how to define a process, but you still have to define each individual step. Learn how to define steps with the Step Inspector!