.. _trafficPublicRoute: Traffic Public Route ===== Defined public route for :ref:`public transport `. How To Create ------------ #. Create necessary :ref:`road segments `. #. Connect the created segments by :ref:`paths `. #. Create an empty `GameObject` and add the :ref:`TrafficPublicRoute ` component. #. Enable the :ref:`Show path selection buttons ` option. #. Sequentially select each :ref:`path ` of the route (also you make a :ref:`lane change `). .. image:: /images/road/PublicRoute/PublicRouteExample2.png `Selection route example.` #. Customize :ref:`Route settings `. #. Make sure you have created at least one compatible (matching :ref:`TrafficPublicType ` and :ref:`Car model `) :ref:`TrafficPublic ` vehicle. Transition Info ------------ Transition paths are used for transition between lanes of public transport. .. _trafficPublicRouteHowToCreateTransition: How To Create ~~~~~~~~~~~~ #. Select source path. .. image:: /images/road/PublicRoute/PublicRouteTransitionExample1.png #. Select a neighbouring path. .. image:: /images/road/PublicRoute/PublicRouteTransitionExample2.png #. Customize :ref:`Transition settings `. .. image:: /images/road/PublicRoute/PublicRouteTransitionExample4.png `Transition result example.` .. _trafficPublicRouteComponent: Component ------------ .. image:: /images/road/PublicRoute/PublicRouteSettings.png .. _trafficPublicRouteSettings: Route settings ~~~~~~~~~~~~ | **Vehicle data collection** : reference to the :ref:`vehicle collection `. | **Max vehicle count** : maximum number of vehicles on the route. | **Preferred interval distance** : preferred distance between public transport vehicles. | **Ignore camera** : if the camera is ignored, public transport can be spawned in view of the camera. .. _trafficPublicType: **Traffic public type** : * **Bus** : for the default path. * **Tram** : for the rail path (:ref:`rail movement ` enabled by default). | **Car model** : :ref:`car model ` of the public transport vehicle that will be spawned on the route. .. _trafficPublicRouteTransitionSettings: Transition settings ~~~~~~~~~~~~ | **Source offset** : offset start point of transition in source path. | **Target offset** : offset end point of transition in target path. | **Distance between parallel nodes** : max distance between :ref:`traffic nodes ` to find a transition path. .. _trafficPublicRouteSceneSettings: Scene settings ~~~~~~~~~~~~ | **Highlight route** : highlight added paths of route. | **Show path selection buttons** : on/off display add buttons paths to route. | **Show swap buttons** : show swap buttons for :ref:`transitions `. | **Show only related nodes** : only nodes that are neighbours of nodes that have already been added will be displayed. Route data ~~~~~~~~~~~~ | **Traffic node route data** : internal related traffic nodes route data. | **Route change lane transitions** : :ref:`transition ` data. | **Routes** : sequence of paths on the route. .. image:: /images/road/PublicRoute/PublicRouteTransitionExample3.png `Transition data example.` Buttons ~~~~~~~~~~~~ | **Update transitions** | **Clear route** | **Refresh related nodes**