.. _pedestrianNode: Pedestrian Node ===== How To Create ---------------- **There are 2 ways:** #. Create node by yourself in the `Unity` toolbar: `Spirit604/Create/PedestrianNode` .. image:: /images/road/pedestrianNode/PedestrianNodeToolbarExample.png #. Create node with :ref:`PedestrianNodeCreator tool `. Pedestrian Node ---------------- `Pedestrian node` is a node for creating :ref:`pedestrian ` route. `Youtube tutorial. `_ .. image:: /images/road/pedestrianNode/PedestrianNode.png Connection Data ~~~~~~~~~~~~ | **Connected traffic node** : connected :ref:`traffic node ` (for parking). | **Related traffic light handler** : connected traffic light. | **Auto connected pedestrian nodes** : connected other nodes along :ref:`selected direction ` raycasts. | **Default connected pedestrian nodes** : connected other nodes by the user. .. _pedestrianNodeConnections: Directions of auto-connections ~~~~~~~~~~~~ Direction of raycasts to connect with other nodes (can be useful for generating squared scenes). .. image:: /images/road/pedestrianNode/PedestrianNodeDirectionsExample.png `All connection directions enabled example.` .. note:: Used by :ref:`road parent `. Custom Node Settings ~~~~~~~~~~~~ Default """""""""""""" Default node for the route. .. _pedestrianNodeSit: Sit """""""""""""" Node for benches, seats, etc (:ref:`test scene `). .. image:: /images/road/pedestrianNode/PedestrianNodeSeatSettings.png | **Show seats** : enable editor display of seats. | **Base offset** : offset between the center of the seats and the center of the node. | **Seat offset** : offset between the seats. | **Enter seat offset** : offset between the animation start position and the seat. | **Seat height** : seat height. | **Capacity** : number of seats (adjustable in the :ref:`settings ` of the node). .. note:: Required `PedestrianNodeSeatSettings` component. .. image:: /images/road/pedestrianNode/PedestrianNodeBenchExample.png `Bench example.` .. _pedestrianNodeHouse: House """""""""""""" Node for entry/exit to the house (:ref:`test scene `). .. tip:: * Enable `Can spawn in view` in the pedestrian node :ref:`settings ` to simulate leaving from the house. * Pedestrians who have entered the house node are will be destroyed. .. _pedestrianNodeIdle: Idle """""""""""""" Node for temporary idling pedestrians (:ref:`test scene `). .. note:: * To set a custom idle time at the node, add the `PedestrianNodeIdleSettings` component. * .. image:: /images/road/pedestrianNode/PedestrianNodeIdleAuthoring.png Car parking """""""""""""" Node to enter/exit a parked car (generated by :ref:`ParkingBuilder `). Read more about :ref:`parking states `. .. image:: /images/road/pedestrianNode/PedestrianNodeParkingExample.png `Parking node example.` .. _pedestrianNodeTalkArea: Talk area """""""""""""" Node for crowd conversations of pedestrians (:ref:`test scene `). **Area shape type:** type of area shape. * **Square** * **Circle** | **Area size** : area size. | **Min/Max spawn count** : min/max number of pedestrians that the area can contain. | **Unlimited talk time** : on/off infinite conversation for pedestrians in the talk area. | **Show bounds** : show bounds of area. .. image:: /images/road/pedestrianNode/PedestrianNodeTalkAreaExample.png `Talk area example.` .. _pedestrianNodeStopStation: Traffic public stop station """""""""""""" Node for waiting for :ref:`public transport `. .. note:: To set the maximum number of waiting vehicle passengers, adjust the :ref:`capacity ` parameter. .. image:: /images/road/pedestrianNode/PedestrianNodeStopStationExample.png `Stop station example.` Traffic public entry """""""""""""" Node for entering :ref:`public transport `. .. image:: /images/road/pedestrianNode/PedestrianNodePublicEntryExample.png `Public entry example (white box).` .. warning:: Entry node should be any `GameObject` with the component :ref:`VehicleEntryAuthoring ` which adds a node with `Traffic public entry` type. Trigger """""""""""""" Node to notify the user that the entity has reached the node. **How to use:** * Activate `TriggerNodeConfig` & sync with the subscene. .. image:: /images/road/trafficNode/TrafficNodeTrigger1.png * If you need to subscribe to this reach event, use `Traffic Node Service`. .. image:: /images/road/trafficNode/TrafficNodeTrigger2.png If you need to associate a scene object with the trigger event, follow these steps: * Activate `EntityBindingConfig` & sync with the subscene. .. image:: /images/core/entityBindingConfig.png * Create a new game object in the scene where the trigger is expected (e.g. cube). .. image:: /images/road/pedestrianNode/PedestrianNodeTrigger1.png * Add `TriggerNodeHybridListener component`. .. image:: /images/road/trafficNode/TrafficNodeTrigger4.png * Press `+` button & set `Binding type` to `Pedestrian node` in the inspector. .. image:: /images/road/pedestrianNode/PedestrianNodeTrigger2.png * Press `+` on the scene node to which you want to associate the current scene object with the entity. .. image:: /images/road/pedestrianNode/PedestrianNodeTrigger3.png `Source scene example.` .. image:: /images/road/pedestrianNode/PedestrianNodeTrigger4.png `Selected node example.` * Now you can listen to entities arriving on this node by subscribing to ``TriggerNodeHybridListener.OnTriggerEnter`` with code in the `TriggerNodeHybridListener` component or by using `UnityEvent` in the inspector of this component. Trigger And Destroy ^^^^^^^^^^^^^^^^^^^^^^ Node to notify the user that the entity has reached the node & then destroy the entity. Use case is the same as the `Trigger type`. .. _pedestrianNodeSettings: Common Settings ~~~~~~~~~~~~ **Shape type** : shape of the area for randomization of :ref:`pedestrian ` targets. * **Circle** * **Square** * **Rectangle** | **Can spawn in view** : can spawn in view of camera or not. | **Capacity** : -1 value is unlimited; Capacity for objects like benchs, houses, public stop stations etc... | **Priority weight** : weight for choosing random node by :ref:`pedestrian `. | **Custom achieve distance** : custom achieve distance for :ref:`pedestrian `. If 0 then default value is taken. | **Chance to spawn** : chance to spawn :ref:`pedestrian ` at node [0 = 0%, 1 = 100%]. | **Max path width** : maximum width of the route around the node. | **Height** : maximum height size of the node area (square and rectangle shapes only). | **Has movement random offset** : are supposed to randomize the position around a node. Buttons ~~~~~~~~~~~~ | **Connect** : node will make raycasts to the :ref:`selected directions ` to connect other nodes. | **Attach to closest traffic node** : trying to connect to a nearby :ref:`TrafficNode `. | **Open advanced connection window** : open :ref:`Advanced connection window `. Hotkeys ~~~~~~~~~~~~ .. image:: /images/road/pedestrianNode/PedestrianNodeCreatorHotkeyConfig.png CullState Info ---------------- :ref:`States ` ~~~~~~~~~~~~ * **Culled** : entity not available for spawning. * **CloseToCamera** : entity available for spawn. * **InVisionOfCamera** : entity available for spawn only during the initial scene start (unless the :ref:`Can spawn in view ` option is enabled). .. _pedestrianNodeCreator: Pedestrian Node Creator ---------------- `Pedestrian Node Creator` is a tool to quickly create and connect :ref:`pedestrian nodes `. `Youtube tutorial. `_ How To Create ~~~~~~~~~~~~ Select in the `Unity` toolbar: `Spirit604/Create/PedestrianNodeCreator` .. image:: /images/road/pedestrianNode/PedestrianNodeCreatorToolbarExample.png How To ~~~~~~~~~~~~ .. _pedestrianNodeCreatorCreate: Create Node """""""""""""" #. Press the `Tab` button on the keyboard to create preview :ref:`PedestrianNode `. #. Place the preview :ref:`PedestrianNode ` at the desired position. #. If you need to attach the :ref:`PedestrianNode ` to a custom shape surface, enable `Auto Attach To Surface` in the `Inspector`. #. Press `E` button on the keyboard to create the final :ref:`PedestrianNode `. .. tip:: You can change the :ref:`hotkeys ` to your taste. .. _pedestrianNodeCreatorSelect: Select Node """""""""""""" #. Choose :ref:`Selection mode `. #. Click `W` above the node to select :ref:`PedestrianNode `. Connect Node """""""""""""" #. :ref:`Select the desired node `. #. Click `E` over the target :ref:`PedestrianNode ` to connect (:ref:`Single selection mode ` only). Locate Node """""""""""""" #. Choose :ref:`Selection mode `. #. :ref:`Select the desired nodes `. #. Drag the position handle to the desired position. .. _pedestrianNodeCreatorSettings: Settings ~~~~~~~~~~~~ .. image:: /images/road/pedestrianNode/PedestrianNodeCreatorSettings.png | **Show handlers** : on/off position handles for nodes. **Show handle type:** * **Only created** : only the created nodes will have handles shown * **Only selected** : only the selected nodes will have handles shown. * **All** : all nodes will have handles shown .. _pedestrianNodeCreatorSelectionMode: **Selection mode:** * **Single** : only 1 node is selected. * **Multiple** : multiple nodes can be selected. * **Multiple handle type:** * **Single** : node has a position handle each individually. * **All** : all nodes have the same position handle. * **Unselect selected** : if you try to select an already selected node, it will be unselected. | **Max path width** : global width of routes for all nodes (enable preview :ref:`here `, save global width :ref:`here `). | **Connect with previous node** : currently created node will be connected to the previously created node. | **Auto select connected node** : node will be selected after it is connected to the source node. | **Allow connect traffic node** : on/off feature to connect to the :ref:`TrafficNode `. **Auto split connection** : if a node is located between a connection of existing nodes, the connection will be reconnected between them (made with a `Raycast`). * **Disabled** * **Right angle** : 90° angle. * **Custom angle** : user custom angle. | **Auto rejoin line** : if there are other nodes on the connection line, they will automatically be connected to each other in one row. **Auto attach to surface** : auto attach created node to surface. * **Surface mask** : layer mask to attach. * **Attach type:** * **Collider** : attach to collider. * **Mesh** : attach to mesh. **Auto snap position** : auto snap node position during creation. * **Snap value** : snapping value. Scene Settings ~~~~~~~~~~~~ .. image:: /images/road/pedestrianNode/PedestrianNodeCreatorSceneSettings.png | **Show path** : show pedestrian node routes. **Show path type:** * **All** : all the nodes will be shown. * **Only created** : only the nodes created by the creator will be shown. **Show node buttons** : on/off display custom buttons of selected nodes. * **Node button type:** * **Delete** : node will be deleted by clicking. * **Unselect** node will be unselected by clicking. | **Show unique info** : unique information of the node will be displayed (different from the original prefab). | **Show reset custom route buttons** : for nodes with a custom route width, the reset buttons will be displayed. .. _creatorShowBorders: **Show border routes** : * **Current** : route will be displayed with the assigned width of the nodes. * **Selected** : route will be displayed with the selected route width in the :ref:`creator settings `. | **Show traffic node connection** : on/off display the connection to the :ref:`TrafficNode `. | **Show selected node settings** : shows :ref:`node settings ` in the inspector. Buttons ~~~~~~~~~~~~ | **Create node** : create preview node. | **Add all scene pedestrian nodes** : all nodes will be added to the creator. | **Add all scene custom pedestrian nodes** : only nodes with custom widths will be added to the creator. .. _creatorSaveGlobalWidth: | **Save global path width** : сhange the width of the route for all nodes. | **Reset all custom path width** : for all nodes with custom widths will be assigned the default value. | **Clear created nodes info** : clear the list of nodes created by the creator. | **Clear selection** : clear selected nodes [multiple selection mode only]. | **Snap to grid** : snap selected node position [for :ref:`selected node ` only, :ref:`auto snap ` should be enabled]. | **Open advanced connection window** : open :ref:`Advanced connection window ` [for :ref:`selected node ` only]. .. _pedestrianNodeCreatorHotkeys: Hotkeys ~~~~~~~~~~~~ .. image:: /images/road/pedestrianNode/PedestrianNodeCreatorHotkeyConfig.png .. _pedestrianNodeAdvancedConnection: Advanced Connection Window ---------------- Help window for advanced node connection settings. Split Connection ~~~~~~~~~~~~ Split the existing connection into several nodes. .. image:: /images/road/pedestrianNode/AdvancedConnectionWindow/SplitConnection.png | **Target pedestrian node** : selected node where the split connections will be. | **Split count** : number of new nodes created between the selected two. .. image:: /images/road/pedestrianNode/AdvancedConnectionWindow/SplitConnectionExample1.png .. image:: /images/road/pedestrianNode/AdvancedConnectionWindow/SplitConnectionExample2.png `Split connection example.` .. note:: Split is available for already connected nodes only. Join To Connection ~~~~~~~~~~~~ Connect the selected node to an existing connection. .. image:: /images/road/pedestrianNode/AdvancedConnectionWindow/JoinToConnection.png | **Target pedestrian node 1** : target node 1 of selected connection. | **Target pedestrian node 2** : target node 2 of selected connection. | **Attach to line** : source node will be moved to the line connecting target nodes. .. image:: /images/road/pedestrianNode/AdvancedConnectionWindow/JoinToConnectionExample1.png .. image:: /images/road/pedestrianNode/AdvancedConnectionWindow/JoinToConnectionExample2.png `Join to connection example 1.` .. image:: /images/road/pedestrianNode/AdvancedConnectionWindow/JoinToConnectionExample3.png .. image:: /images/road/pedestrianNode/AdvancedConnectionWindow/JoinToConnectionExample4.png `Join to connection example 2 (attach to line enabled).` Create Custom Route Width ~~~~~~~~~~~~ Create a custom route with custom width between two nodes. .. image:: /images/road/pedestrianNode/AdvancedConnectionWindow/CreateCustomRouteWidth.png | **Target pedestrian node 1** : target connected node of selected connection. | **Custom route width** : new width of custom route. | **Offset from nodes** : new created nodes offset from existing nodes. .. image:: /images/road/pedestrianNode/AdvancedConnectionWindow/CreateCustomRouteWidthExample1.png .. image:: /images/road/pedestrianNode/AdvancedConnectionWindow/CreateCustomRouteWidthExample2.png `Create custom route width example.` Change Current Route Width ~~~~~~~~~~~~ Set the custom width to the two selected nodes. .. image:: /images/road/pedestrianNode/AdvancedConnectionWindow/ChangeCurrentRouteWidth.png | **Target pedestrian node 1** : target connected node of selected connection. | **Custom route width** : new width of custom route. .. image:: /images/road/pedestrianNode/AdvancedConnectionWindow/ChangeCurrentRouteWidthExample1.png .. image:: /images/road/pedestrianNode/AdvancedConnectionWindow/ChangeCurrentRouteWidthExample2.png `Change current route width example.`