PaleBlue provides a number of node blocks. This section describes some of the main use cases for Flow.
To open Flow, select [FLOW] object on scene and click EDIT FLOW SCRIPT button in inspector
Teleport
By default, teleporting is allowed in the scene, so you just need to set up a Teleport Area.
Show UI Dialogs
Dialogs allow to present certain information, or to ask questions to assess knowledge and understanding.
Here’s how to create a simple UI dialog with a question:
- Right click in Flow to Add node, then select PaleBlue → UI Dialog
- A new UI Dialog node is created and its properties are opened
- You can make your UI Dialog a Yes/No dialog by selecting the appropriate buttons in the Buttons dropdown
- Set the Title and the Dialog Text fields to have the title and a question, like shown above
- Connect the In port for Flow coming in, and the Out ports for Yes and No for Flow coming out
- Can be a good idea to make a Notification to the user on whether the answer was correct or not, see the Notification section below
Give Positive and Negative Notifications
Notifications are those Green and Red icons with a distinct sound, that make player aware of whether the action was correct or incorrect.
Here’s a simple example: depending on the player’s answer in a UI dialog, either Positive or Negative notification will be shown:
In order to create a Notification that’s Positive:
- Right click in Flow to Add node, then select PaleBlue → Notification Correct
- This notification will play a sound and show a correct icon when flow reaches it
- Connect the In and Done ports according to your logic
In order to create a Notification that’s Negative:
- Right click in Flow to Add node, then select PaleBlue → Notification Wrong
- This notification will play a sound and show a correct icon when flow reaches it
- Connect the In and Done ports according to your logic
Speak with Text-to-Speech Voice
It’s a great way to guide the user through the course by using voice for briefing and feedback. We have an automated voice system built-in, so you don’t need voice actors!
- Open Flow
- Right click in Flow to Add node, then select PaleBlue → Play Voice
- A new Play Voice node is created and its properties are opened
- Type in the text you want the system to speak out into the Text field
- Connect the Play Voice node to other nodes in your flow
- Note that this node has two exit ports.
- Out is executed immediately after voice playback starts
- Done waits first for the voice to fully play, and executes only then - it’s usually a good idea to wait with other actions until voice is fully played
- That’s it. You can run your flow, and the voice will be played when this Play Voice node is reached.
Show and Hide Scene Objects
A lot of scenarios in training involve objects appearing or hiding. This is usually the case when some new taks is given, and new interactive equipment is presented. Or, when a task is done, objects can be removed from the scene and the player can move on to something else.
This is done by having all the objects in place in the scene from the very start, and hiding and showing them as the scenario flow progresses.
So let’s take a look how hiding is done.
- Right click in Flow to Add node, then select PaleBlue → Show Hide Objects
- A new Show Hide Objects node is created and its properties are opened
- Point Selectable Object to some pre-existing object in the scene.
- Make sure that Active State is off, as we will be hiding it
- Connect the In port for Flow coming in, and the Out port for going out
- That’s it! When this node is executed, the object in question will be hidden.
Grab & Put Objects into Slots
Note that by Slot we mean any arbitrary place in the scene. Putting into slots does not necessarily mean inserting an object into some other object. A Slot is just a destination position and orientation of an object, and therefore Slot could be just be hanging in thin air.
First, we need to make sure that our scene has an object for grabbing, and we will create a slot for it:
- We will use this 3D object that looks like a folder as our grabbable object
- For an object to be grabbable, it needs to have a Rigidbody components, so let’s make sure it has that
- Gravity is not really needed, so you can disable that
- Object is set up for grabbing. Let’s make a slot to put it into.
- The easiest way to do that is to duplicate the object and change the material on it. So let’s duplicate the object by right clicking on the objects and selecting Duplicate.
- A copy is created. Let’s move it a bit to a side, and change the name to Folder Slot.
- PaleBlue Trainer comes with a neat function to convert your duplicated object into a ready-configured slot. Select your Slot object in Hierarchy, then right click and select PaleBlue → Convert to Slot
- That’s it! Our scene is set up and ready for the Flow logic to be created.
So, let’s build the Flow to grab our Folder object and put it into Folder Slot slot.
- To enable grabbing and putting into slots, you will use Enable Slot node in your Flow
- Right click in Flow to Add node, then select PaleBlue → Enable Slot
- A new Enable Slot node is created and its properties are opened
- Single Object is the simplest Selection Mode to start with
- Point the Target Slot to the Slot object you’ve created previously
- Point the Slottable Object selector to the Object in scene you’d like to grab
- Connect the node in and out ports somewhere early in your Flow to enable the grabbing early on.
- There’s two outgoing ports: Out executes momentarily, while Slotted waits for the object to be slotted, and only then executes
- Done! As soon as this node executes, the object will become grabbable by player, and it will be possible to put it into the designated slot.
Note that there is also a node called Allow Free Grab. This node enables you to grab objects without any other practical purpose. So unless you want to make your world more fun, with an ability to lift different objects around you, the Enable Slot node is what you really need.