.. _roadSegmentCreator: Road Segment Creator ===== `Road Segment Creator` is a tool for creating and customizing a :ref:`RoadSegment` .. contents:: :local: .. _roadSegmentCreatorHowToUse: How To Use ------------ `Youtube tutorial. `_ #. Create a :ref:`RoadSegment`. #. Place the segment at the desired position. #. By default, :ref:`RoadSegment` prefab contains `RoadSegmentCreator` component. #. Select the :ref:`Road segment type ` depending on the :ref:`shape ` of your intersection. * :ref:`Standard shape ` used for the most common shapes (T-cross, X-cross & etc). * :ref:`Custom segment ` used for intersection with custom shape. * :ref:`Custom straight ` used on straight roads with curves or long straight roads. .. image:: /images/road/roadSegment/creator/RoadsegmentCreatorGeneralSettings.png #. In the other tab, you can convert any :ref:`Standard shape ` segment to a :ref:`Custom segment ` for more flexibility (also check out the new :ref:`Auto-Crossroads ` feature for automatic crossroad generation). #. Adjust :ref:`general settings`. #. Adjust :ref:`custom settings`. #. Customize :ref:`light settings`. #. Customize :ref:`path settings`. #. Add :ref:`RoadSegment` to the :ref:`RoadParent ` as children. .. _roadSegmentCreatorCustomSettings: Standard Shapes ------------ `Youtube tutorial. `_ Default Crossroad ~~~~~~~~~~~~ .. image:: /images/road/roadSegment/creator/RoadsegmentCreatorDefaultCrossroadSettings.png | **Direction count** : number of sides of the crossroad. .. image:: /images/road/roadSegment/examples/RoadSegmentDefault.png `Example`. Turn Road ~~~~~~~~~~~~ .. image:: /images/road/roadSegment/creator/RoadSegmentTurnRoadSettings.png | **Node 1 offset** : node 1 offset on the X-axis. | **Node 2 offset** : node 2 offset on the X-axis. | **Additional local angle 1** : additional node 1 rotation angle. | **Additional local angle 2** : additional node 2 rotation angle. .. image:: /images/road/roadSegment/examples/RoadSegmentTurnRoad.png `Example`. Straight Road ~~~~~~~~~~~~ .. image:: /images/road/roadSegment/creator/RoadSegmentStraightSettings.png | **Node 1 offset** : node 1 offset on the X-axis. | **Node 2 offset** : node 2 offset on the X-axis. | **Traffic node height 1** : node 1 offset on the Y-axis. | **Traffic node height 2** : node 2 offset on the Y-axis. .. image:: /images/road/roadSegment/examples/RoadSegmentStraight.png `Example`. Merge Crossroad ~~~~~~~~~~~~ .. image:: /images/road/roadSegment/creator/RoadSegmentTransitionCrossroadSettings.png | **Direction count** : number of sides of the crossroad. | **Sub-lane count** : number of sub-lanes (a sub-lane is a lane with a different number of lanes than the main lane). | **SubTrafficNode distance from center** : distance between the `SubTrafficNode` (node that contains a sub-lane) and the center of the segment. .. image:: /images/road/roadSegment/examples/RoadSegmentTransitionCrossroad.png `Example`. Merge Straight Road ~~~~~~~~~~~~ .. image:: /images/road/roadSegment/creator/RoadSegmentTransitionStraightRoadSettings.png | **Sub-lane count** : number of sub-lanes (a sub-lane is a lane with a different number of lanes than the main lane). | **Node 1 offset** : node 1 offset on the X-axis. | **Node 2 offset** : node 2 offset on the X-axis. | **Traffic node height 1** : node 1 offset on the Y-axis. | **Traffic node height 2** : node 2 offset on the Y-axis. .. image:: /images/road/roadSegment/examples/RoadSegmentTransitionStraightRoad.png `Example`. Merge Crossroad To Oneway Road ~~~~~~~~~~~~ .. image:: /images/road/roadSegment/creator/RoadSegmentTransitionCrossroadToOneWaySettings.png | **Direction count** : number of sides of the crossroad. | **Sub-lane count** : number of sub-lanes (a sub-lane is a lane with a different number of lanes than the main lane). | **SubTrafficNode distance from center** : distance between the `SubTrafficNode` (node that contains a sub-lane) and the center of the segment. | **Is enter of oneway** : if it is on, it is the start of one-way traffic, if it is off, it is the end of one-way traffic. .. image:: /images/road/roadSegment/examples/RoadSegmentTransitionCrossroadToOneWay.png `Example`. Oneway Straight ~~~~~~~~~~~~ .. image:: /images/road/roadSegment/creator/RoadSegmentOneWayStraightSettings.png | **Node 1 offset** : node 1 offset on the X-axis. | **Node 2 offset** : node 2 offset on the X-axis. | **Traffic node height 1** : node 1 offset on the Y-axis. | **Traffic node height 2** : node 2 offset on the Y-axis. | **Should revert direction** : direction of the crossroad lanes will be reversed. .. image:: /images/road/roadSegment/examples/RoadSegmentOneWayStraight.png `Example`. Oneway Turn ~~~~~~~~~~~~ .. image:: /images/road/roadSegment/creator/RoadSegmentOneWayTurnSettings.png | **Node 1 offset** : node 1 offset on the X-axis. | **Node 2 offset** : node 2 offset on the X-axis. | **Additional local angle 1** : additional node 1 rotation angle. | **Additional local angle 2** : additional node 2 rotation angle. | **Should revert direction** : direction of the crossroad lanes will be reversed. .. image:: /images/road/roadSegment/examples/RoadSegmentOneWayTurn.png `Example`. .. _roadSegmentCreatorCustomStraight: Custom Straight Road ------------ Creator for creating straight roads of any shape. `Youtube tutorial. `_ How To Use ~~~~~~~~~~~~ #. Place the custom straight segment where you want it. #. Place the :ref:`traffic nodes ` at the start and the end of the path (or expand the road by holding `left-shift` key and clicking the `left-mouse` button). #. Rotate the :ref:`TrafficNodes ` in the direction of the route (make sure that the :ref:`rotation of the nodes ` is set correctly). #. Adjust the number of lanes and the speed limit of the segment. #. If necessary, add more additional nodes to the paths (by pressing `+` in the scene) **[optional step]**. #. Rotate the nodes of the paths according to the direction of the path **[optional step]**. #. :ref:`Snap ` :ref:`TrafficNodes ` to the surface by pressing the `Snap To Surface` button if necessary **[optional step]**. #. Complete all the :ref:`default steps `. Settings ~~~~~~~~~~~~ Custom Settings """""""""""""" .. image:: /images/road/roadSegment/creator/RoadSegmentCustomStraightCustomSettings.png | **One way** : segment contains only one-way paths. | **Lock Y axis move** : lock the Y axis to move the nodes. | **Show Y position** : show Y position of the nodes. Snap Node Settings """""""""""""" .. image:: /images/road/roadSegment/creator/RoadSegmentCustomStraightSnapNodeSettings.png :ref:`Info `. Snap Surface Settings """""""""""""" .. image:: /images/road/roadSegment/creator/RoadSegmentCustomStraightSnapSurfaceSettings.png | **Snap surface offset** : offset between snap point and the node (Y axis). **Node Buttons** : which node you want to snap to. * All * Node1 * Node2 **Buttons:** * Snap to surface: snap selected nodes to the surface. .. _snapLine: Snap Line Settings """""""""""""" Creates additional :ref:`path nodes ` along the curved meshes of the collider to make the :ref:`path ` follow the shape of the collider **(v 1.0.4+)**. .. image:: /images/road/roadSegment/creator/RoadSegmentCustomStraightSnapLineSettings.png | **Angle threshold** : minimum angle between normal faces to create new :ref:`path nodes `. | **Min waypoint offset** : min offset between generated :ref:`path nodes `. | **Snap surface offset** : offset between snap point and the node (Y axis). .. only:: builder_html .. image:: /images/road/roadSegment/creator/SnapLineExample.gif `Example.` .. _roadSegmentCreatorCustomStraightPathSettings: Path Settings """""""""""""" .. image:: /images/road/roadSegment/creator/RoadSegmentCustomStraightPathSettings.png | **Show edit buttons path nodes** : on/off edit (add & remove) button paths of node. | **Show traffic node handles** : on/off traffic node position handles. | **Show traffic node forward** : on/off display of node's forward direction. | **Speedlimit** : speed limit for all paths of the segment. Examples """""""""""""" .. image:: /images/road/roadSegment/examples/RoadSegmentCustomStraight.png `Source segment example.` .. image:: /images/road/roadSegment/examples/RoadSegmentCustomStraight2.png `Complex shape example.` .. image:: /images/road/roadSegment/examples/RoadSegmentCustomStraightSnapExample.png `Surface snapping example.` .. _roadSegmentCreatorCustomSegment: Custom Segment ------------ Creator for creating segments of any shape and complexity. `Youtube tutorial. `_ How To Use ~~~~~~~~~~~~ #. Place the custom segment where you want it. #. Toggle on :ref:`Custom settings ` parameter. #. Select the `New node settings type` & create a new :ref:`TrafficNode ` by pressing the `Add Traffic Node` button **[optional step]**. #. :ref:`Place ` & rotate all created :ref:`TrafficNode ` according to your needs (make sure that the :ref:`rotation of the nodes ` is set correctly). #. :ref:`Snap ` :ref:`TrafficNodes ` to the surface by pressing the `Snap To Surface` button if required **[optional step]**. #. Open the :ref:`PathCreator tool ` to quickly create :ref:`paths ` between :ref:`nodes ` or :ref:`auto-generate ` crossroad. #. Complete all the :ref:`default steps `. .. note:: You can convert any :ref:`default template ` to `Custom Segment`_ in the `Other settings`_ tab. Settings ~~~~~~~~~~~~ New Node Settings """""""""""""" .. image:: /images/road/roadSegment/creator/RoadSegmentCustomNewNodeUniqueSettings.png .. _roadSegmentCreatorCustomCustomSettingsOption: | **Custom settings** : on/off custom settings for advanced node customization. New node settings type [custom settings enabled] new :ref:`TrafficNode ` will be created like: * **Prefab** : new prefab. * **Unique** : created with unique defined :ref:`settings `. * **Copy last** : will be created with the settings of the last created node. * **Copy selected** : will be created with the settings of the selected node. * **Copy node index** Custom Path Settings """""""""""""" .. image:: /images/road/roadSegment/creator/RoadSegmentNodeHandles.png | **Show traffic node handles** : on/off handles of :ref:`TrafficNodes ` | **Show traffic node forward** : on/off display of :ref:`TrafficNode ` forwading. Additional Settings ~~~~~~~~~~~~ .. _extrudeLane: Extrude Lane """""""""""""" .. image:: /images/road/roadSegment/creator/ExtrudeLaneSettings.png **How to use:** #. Drag the green sphere from where you want the new lane to start. #. Drop the cursor where you want the lane to end. #. Adjust the position handle of the new path. #. Press `E` key or press `Create` button in the inspector to create new lane. .. only:: builder_html .. image:: /images/road/roadSegment/creator/ExtrudeLaneExample.gif `Example.` Custom Settings """""""""""""" .. image:: /images/road/roadSegment/creator/RoadSegmentCustomCustomSettings.png | **Lock Y axis move** : lock the Y axis to move the nodes. | **Show Y position** : show Y position of the nodes. .. _roadSegmentCreatorCustomSnapNodeSettings: Snap Node Settings """""""""""""" .. image:: /images/road/roadSegment/creator/RoadSegmentCustomSnapNodeSettings.png :ref:`Info `. Custom TrafficNode Editor Window """""""""""""" Window that you can configure each :ref:`TrafficNode settings `. :ref:`Custom settings ` should be enabled. .. image:: /images/road/roadSegment/creator/RoadSegmentCustomTrafficNodeEditorWindow.png Examples """""""""""""" .. image:: /images/road/roadSegment/examples/RoadSegmentCustomExample.png `Example`. Settings Description ~~~~~~~~~~~~ .. _roadSegmentCreatorId11: Snap Node Settings """""""""""""" **Snap object type:** * **All** : snap `TrafficNode` & `Path node`. * **Traffic node** : only `TrafficNode`. * **Path node** : only `Path node`. **Auto-snap position** on/off position snapping. * **Add half offset** : the snapped object is shifted by half of the set snapping size. | **Auto snap custom size** : snapping value. **Auto round rotation:** : on/off rotation snapping. * **Round angle** : snapping angle value. Components ------------ .. _roadSegmentCreatorGeneralSettings: General settings ~~~~~~~~~~~~ .. image:: /images/road/roadSegment/creator/RoadsegmentCreatorGeneralSettings.png | **Lane count** : number of lanes. | **Lane width** : lane width. | **Crossroad width** : distance between :ref:`traffic nodes `. | **Path corner offset** : offset to change the rotation angle of curved paths. Custom settings ~~~~~~~~~~~~ :ref:`Custom settings `. .. _roadSegmentCreatorLightSettings: Light settings ~~~~~~~~~~~~ .. image:: /images/road/roadSegment/creator/RoadsegmentCreatorLightSettings.png `Youtube tutorial. `_ How To Use """""""""""""" #. Turn on traffic light option. #. Select `Light prefab type`. #. Set the traffic light offset or enable `Light handle type`. #. If you want to configure the traffic lights individually, select the `Node` button with the appropriate index. Traffic lights """""""""""""" | **Show light indexes** : on/off display light :ref:`TrafficLightHandler ` index around :ref:`traffic nodes ` and traffic lights in the scene. | **Min TrafficNodes count for add light** : minimum number of :ref:`traffic nodes ` in the segment to add traffic light. | **Add traffic light** : add traffic light to the segment. **Light handle type:** * **None** * **Position** : enable position handle for traffic lights. * **Rotation** : enable rotation handle for traffic lights. **Selected light prefab type** : prefab of the traffic light to be added [can be changed in creator settings]. * **Oneway** * **Two way** * **Four way** **Light location** : * **Right** : will be added to the right of the :ref:`traffic nodes `. * **Left** : will be added to the left of the :ref:`traffic nodes `. * **Right left** : will be added on both sides of the :ref:`traffic node `. | **Traffic lights offset** : local traffic light offset relative to :ref:`traffic node `. **Light angle offset settings:** * **Angle offset** : local rotation angle of the traffic light. * **Flip index** : switches to the opposite :ref:`light index ` in the traffic light. Pedestrian lights """""""""""""" | **Add pedestrian lights** : add pedestrian light to the segment. | **Pedestrian light offset** : local pedestrian light offset relative to :ref:`traffic node ` | **Pedestrian angle offset** : pedestrian light rotation angle offset. .. _roadSegmentCreatorPathSettings: Path settings ~~~~~~~~~~~~ .. image:: /images/road/roadSegment/creator/RoadsegmentCreatorPathSettings.png Node selection panel """""""""""""" **How to customize path:** #. Select `TrafficNode` on the inspector panel. #. Select desired :ref:`path ` on the inspector panel (it will be highlighted in the scene). #. Adjust the position of the path nodes (make sure :ref:`path handles ` is enabled). #. Press `Open Path Settings` button to customize :ref:`Path settings window`. Road settings """""""""""""" **StraightRoad settings:** [:ref:`settings ` for straight paths of the segment] * **Waypoint Straightroad count** * **Straight road path speed limit** * **Straight road priority** **TurnRoad settings:** [:ref:`settings ` for turn paths of the segment] * **Turn curve type** * **Waypoint turn curve count** * **Turnroad path speed limit** * **Turnroad priority** .. _roadSegmentCreatorPathSceneSettings: Scene settings """""""""""""" **Show path handles** : on/off position handles in the scene. * **Show edit buttons path nodes** : on/off `add` & `remove` buttons nodes in the scene. **Show waypoints** : on/off visual circle position of the waypoint in the scene. * **Show waypoints info** : on/off info of waypoints (local index, speedlimit). Turn connection settings """""""""""""" | **Custom node turn settings** : on/off the turn settings for each :ref:`traffic node `. | **Left turn count** : number of left turns from the :ref:`traffic node `. | **Right turn count** : number of right turns from the :ref:`traffic node `. | **Lane left turn connection count** : number of connections to the left from the lane traffic lane. | **Lane right turn connection count** : number of connections to the right from the lane traffic lane. .. _roadSegmentCreatorSegmentSettings: Segment handler settings ~~~~~~~~~~~~ .. image:: /images/road/roadSegment/creator/RoadsegmentCreatorSegmentHandlerSettings.png | **Show segment position handle** : on/off position handle for segment. | **Snap segment position** : on/off snap segmant position. | **Add half offset** : the snapped object is shifted by half of the set snapping size. | **Custom snap size** : snapping value. | **Snap surface offset** : snap surface offset. | **Snap layer mask** : snap layermask. | **Snap segment to surface** : snap the segment to the surface. Other settings ~~~~~~~~~~~~ .. image:: /images/road/roadSegment/creator/RoadsegmentCreatorOtherSettings.png | **Merge segment** : opens the merge segment tool. | **Convert to custom** : converts the current segment to :ref:`custom segment `. | **Save prefab paths** : segment save prefab path. | **Save to prefab** : save segment to prefab. Buttons """""""""""""" | **Rotate -90°/90°** : rotate segment by 90° degree. | **Recreate** : recreate segment. | **Clear** : clear segment. Hotkeys ~~~~~~~~~~~~ | **Capslock** : rotate segment by 90° degree. .. _roadSegmentCreatorAuto: Auto Crossroad ------------ For automatic generation of custom crossroads, use this feature. How To Use ~~~~~~~~~~~~ #. Create a :ref:`Custom road segment `. .. image:: /images/road/roadSegment/auto/AutoCrossroad0.png #. Open the `Path Settings` tab & enable the `Auto-Crossroads` option in the `Additional Settings` dialog. .. image:: /images/road/roadSegment/auto/AutoCrossroad1.png #. Press the `Clear` button to delete existing :ref:`paths `. #. Place :ref:`Traffic nodes ` at the entrances/exits of the intersection. .. image:: /images/road/roadSegment/auto/AutoCrossroad2.png #. Press the `Create` button. .. image:: /images/road/roadSegment/auto/AutoCrossroad3.png #. If you want to avoid connection for certain :ref:`Traffic nodes ` select indexes according to scene indexes & press `Add` button, then press `Create` button again. #. For example 1-3 & 3-1 nodes. .. image:: /images/road/roadSegment/auto/AutoCrossroad4.png #. 1-3 & 3-1 nodes no longer connected. .. image:: /images/road/roadSegment/auto/AutoCrossroad5.png `Example result.` #. If you are missing a connection, use the :ref:`Path Creator ` to add missing paths. .. _deadEnd: Dead End ------------ Destroy ~~~~~~~~~~~~ If you want traffic to be destroyed at the dead end (e.g. when it drives beyond the scene), enable the `Destroy vehicle` type in the :ref:`Traffic node `. U Turn ~~~~~~~~~~~~ To create u turn path: #. Open :ref:`Path Creator ` tool. #. Select desired :ref:`Traffic node ` for u turn. #. Enable `U turn` option in the `Node settings` tab. #. Enable `Connect same side` option & set `Source node side` to `External side`. #. Press `Create` button.