2023.1.1175.2 Junction Cue
Overview
The goal of the Junction Cue is to make it possible to connect splines together to form road junctions so that actors on the incoming spline can chose on which outgoing spline to continue their journey. The Junction Cue is based on the DES Cue and it needs a DES Instructor to control the switching between the outgoing splines. Please find some screenshots and videos in the “How to Use” paragraph at the end of this page.
Example: The Junction Cue is used to let an AGV deliver boxes to different conveyor belts.
Where to find
The Junction Cue can be found under Add Component in the Inspector as shown below. It is not yet available under the Prespective Menu. The Junction Cue must be parented under a DSpline in the hierarchy.
Feature Layout
The following image shows the complete feature layout of the Junction Cue inspector. The top part of the Inspector is related to the DESCue baseclass and it is therefore described in the DESCue User Documentation https://unit040.atlassian.net/wiki/spaces/PRDO/pages/1981087829 . The bottom part is related to the Junction Cue and each field is described below.
Junction Settings |
|
Main Junction Point |
|
Target Spline | Specify the spline connected to the Junction Point:
This field is not visible for the Main Junction Point Spline, because this spline is implicitly defined as the parent Spline of the Junction Cue in the hierarchy. |
Junction Mode | Use pull down menu to select how the Junction Point is connected to the Main Spline:
|
Access Switching | This pull down menu selects from which direction an actor can go over the junction point:
|
Target Control Point | Pull down menu selects which spline control point to connect to:
This field is shown when Junction Mode = Control Point |
Spline Percentage | Specify at which percentage of the spline the Junction Point is on. This field is only shown when Junction Mode is set to Spline Percentage. The range is 0.0 - 1.0 (not 0-100). |
Distance From Spline Start | Specify the distance between the start of the spline and the Junction Point in Unity units. This field is only shown when Junction Mode is set to Spline Distance From Start. |
Distance From Spline End | Specify the distance between the end of the spline and the Junction Point in Unity units. This field is only shown when Junction Mode is set to Spline Distance From End. |
Add Junction Point (button) | Button adds an extra Connected Junction Point. |
Remove Junction Point (button) | Button removes the specific Connected Junction Point |
Enable Snapping Mode (toggle) | This toggle button is used to enable/disable snapping mode:
Snapping is only possible if the junction points that need to snap are in Junction Mode Control Point. In any other mode this button will disappear and a warning will be shown. |
Snapping Mode | Sets the target spline to snap to:
|
How to use
The JunctionCue can only be inserted manually at this moment:
Add a JunctionCue to a Spline
Create empty game object > Add Component > DES Controller
Create empty game object > Add Component > D Spline
Create empty game object > Add Component > Junction Cue
Parent the DSpline under the DES Controller
Parent the Junction Cue under the DSpline
Set the Junction Mode to Spline Percentage:
Inspector > Junction Settings > Main Junction Point > Junction Mode = Spline PercentageSet the Junction Cue position on the spline either by:
1. Set the SplinePercentage, or
2. Enable “Retain World Position” toggle button and move the JunctionCue using the arrow gizmo
Snap Two Splines Together
Create empty game object > Add Component > DES Controller
Create empty game object > Add Component > D Spline > Rename to MainSpline
Create empty game object > Add Component > D Spline > Rename to ConnectedSpline
Create empty game object > Add Component > Junction Cue
Parent both DSplines under the DES Controller
Parent the Junction Cue under the MainSpline
Select the DES Controller > Inspector > Transform > Reset (resets XYZ)
Select the ConnectedSpline
Set ControlPoint[2] to X=0 Z=1
Select the Junction Cue
Main Junction Point > Junction Mode = Spline Percentage
Drag the ConnectedSpline from the hierarchy to the TargetSpline of ConnectedJunctionPoint#0
Connected Junction Point #0 > Junction Mode = Control Point
Enable Snapping Mode = Turn the toggle box ON
SnappingMode = Main Junction Point
Move the JunctionCue along the MainSpline in two ways:
1. Set the SplinePercentage of MainJunctionPoint
2. Enable the “Retain World Position” toggle button (top of inspector) and move the JunctionCue using the arrow gizmo
Prespective Documentation