Pedestrian Node

How To Create

There are 2 ways:
  1. Create node by yourself in the Unity toolbar:

    Spirit604/Create/PedestrianNode

    _images/PedestrianNodeToolbarExample.png
  2. Create node with PedestrianNodeCreator tool.

How To Connect

There are 2 ways:
  1. Select a node in the hierarchy or on the scene and press Tab over the node you want to connect to.

  2. Use the PedestrianNodeCreator tool: select the initial node by pressing W above it and connect it to another node by pressing E.

Note

Hotkeys can be modified in the PedestrianNodeHotkeyConfig asset.

Pedestrian Node

Pedestrian node is a node for creating a pedestrian route.

Youtube tutorial.

_images/PedestrianNode.png

Connection Data

Connected traffic node : connected traffic node (for parking).
Related traffic light handler : connected traffic light.
Auto connected pedestrian nodes : other nodes connected along selected direction raycasts.
Default connected pedestrian nodes : other nodes connected manually by the user.

Directions of auto-connections

Directions of raycasts to connect with other nodes (useful for generating grid/squared layouts).

_images/PedestrianNodeDirectionsExample.png

All connection directions enabled example.

Note

Used by road parent.

Custom Node Settings

Default

Default node for the route.

Sit

Node for benches, seats, etc. (test scene).

_images/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 individual seats.
Enter seat offset : offset between the animation start position and the seat.
Seat height : seat height.
Capacity : number of seats (adjustable in the settings of the node).

Note

Requires PedestrianNodeSeatSettings component.

_images/PedestrianNodeBenchExample.png

Bench example.

House

Node for entry/exit to a house (test scene).

Tip

  • Enable Can spawn in view in the pedestrian node settings to simulate leaving from the house.

  • Pedestrians who have entered the house node will be destroyed.

Idle

Node for temporary idling pedestrians (test scene).

Note

  • To set a custom idle time at the node, add the PedestrianNodeIdleSettings component.

_images/PedestrianNodeIdleAuthoring.png

Car parking

Node to enter/exit a parked car (generated by ParkingBuilder). Read more about parking states.

_images/PedestrianNodeParkingExample.png

Parking node example.

Talk area

Node for crowd conversations of pedestrians (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 the area.
_images/PedestrianNodeTalkAreaExample.png

Talk area example.

Traffic public stop station

Node for waiting for public transport.

Note

To set the maximum number of waiting vehicle passengers, adjust the capacity parameter.

_images/PedestrianNodeStopStationExample.png

Stop station example.

Traffic public entry

Node for entering public transport.

_images/PedestrianNodePublicEntryExample.png

Public entry example (white box).

Warning

Entry node should be any GameObject with the VehicleEntryAuthoring component, 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.

    _images/TrafficNodeTrigger1.png
  • If you need to subscribe to this reach event, use Traffic Node Service.

    _images/TrafficNodeTrigger2.png

If you need to associate a scene object with the trigger event, follow these steps:

  • Activate EntityBindingConfig & sync with the subscene.

    _images/entityBindingConfig.png
  • Create a new game object in the scene where the trigger is expected (e.g. cube).

    _images/PedestrianNodeTrigger1.png
  • Add TriggerNodeHybridListener component.

    _images/TrafficNodeTrigger4.png
  • Press + button & set Binding type to Pedestrian node in the inspector.

    _images/PedestrianNodeTrigger2.png
  • Press + on the scene node to which you want to associate the current scene object with the entity.

    _images/PedestrianNodeTrigger3.png

    Source scene example.

    _images/PedestrianNodeTrigger4.png

    Selected node example.

  • Now you can listen to entities arriving at 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.

Crosswalk Node

Node used to place crosswalks in arbitrary positions without using traffic nodes and road segments.

For detailed setup instructions, configuration details, and system behavior, read the Custom Crosswalk section.

Common Settings

Allowed groups : bitmask that determines which pedestrian groups (e.g., Civilians, Police) are allowed to spawn on or travel through this node. (See Allowed Groups).
Shape typeshape of the area for randomization of 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 benches, houses, public stop stations, etc.
Priority weight : weight for choosing a random node by pedestrian.
Custom achieve distance : custom achieve distance for pedestrian. If 0, the default value is used.
Chance to spawn : chance to spawn 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 : whether position randomization around a node is enabled.

Buttons

Connect : node will make raycasts to the selected directions to connect to other nodes.
Attach to closest traffic node : attempt to connect to a nearby TrafficNode.
Open advanced connection window : open Advanced connection window.

Hotkeys

_images/PedestrianNodeCreatorHotkeyConfig.png

Custom Crosswalk

Allows placing a crosswalk in an arbitrary position without using Traffic Node and Road Segment.

How To Use

  • Place pedestrian nodes where the crosswalk will be.

  • Connect them with each other and other non-crosswalk nodes.

    _images/customCrosswalk1.png
  • Set Node type to Crosswalk node (the node color will change to cyan after changing the type).

    _images/customCrosswalk2.png
  • Add the PedestrianCrosswalkNodeAuthoring component to both nodes.

  • Select one node of the crosswalk and select traffic paths where vehicles drive by clicking “+” in the scene view.

    _images/customCrosswalk3.png
  • Repeat this step for the second node.

  • Adjust parameters in PedestrianCrosswalkConfigAuthoring if needed.

  • Traffic will now react to pedestrians moving on that crosswalk.

Note

Pedestrians evaluate approaching vehicles before crossing. If a vehicle’s calculated braking distance is greater than its distance to the crosswalk (meaning the vehicle cannot stop in time due to its speed and will hit the pedestrian), the pedestrian will wait and avoid entering the crosswalk.

Crosswalk Config

The PedestrianCrosswalkConfigAuthoring component configures pedestrian behavior near crosswalks based on approaching traffic:

  • Min Speed — Minimum vehicle speed in km/h to be considered a potential hazard. Vehicles moving slower than this speed are ignored by pedestrians.

  • Braking Rate — Multiplier used to calculate the vehicle’s safe braking distance (braking distance = vehicle speed * braking rate). If an approaching vehicle is closer than this calculated braking distance, the pedestrian determines the vehicle cannot stop in time and will pause/wait to avoid getting hit.

  • Distance From Crosswalk — Distance threshold from the previous pedestrian node. Once the pedestrian walks beyond this distance, the crosswalk tracking system stops checking for traffic.

  • Idle Action — The action state assigned to the pedestrian (e.g., waiting) when stopping for oncoming vehicles.

CullState Info

States

  • Culled : entity not available for spawning.

  • CloseToCamera : entity available for spawning.

  • InVisionOfCamera : entity available for spawning only during the initial scene start (unless the Can spawn in view option is enabled).

Pedestrian Node Creator

Pedestrian Node Creator is a tool to quickly create and connect pedestrian nodes.

Youtube tutorial.

How To Create

Select in the Unity toolbar:

Spirit604/Create/PedestrianNodeCreator

_images/PedestrianNodeCreatorToolbarExample.png

How To

Create Node

  1. Press the Tab button on the keyboard to create a preview PedestrianNode.

  2. Place the preview PedestrianNode at the desired position.

  3. If you need to attach the PedestrianNode to a custom shape surface, enable Auto Attach To Surface in the Inspector.

  4. Press E button on the keyboard to create the final PedestrianNode.

    Tip

    You can change the hotkeys to your liking.

Select Node

  1. Choose Selection mode.

  2. Click W above the node to select PedestrianNode.

Connect Node

  1. Select the desired node.

  2. Click E over the target PedestrianNode to connect (Single selection mode only).

Locate Node

  1. Choose Selection mode.

  2. Select the desired nodes.

  3. Drag the position handle to the desired position.

Settings

_images/PedestrianNodeCreatorSettings.png
Show handlers : on/off position handles for nodes.
Show handle type:
  • Only created : handles will be shown only for created nodes.

  • Only selected : handles will be shown only for selected nodes.

  • All : handles will be shown for all nodes.

Selection mode:
  • Single : only 1 node is selected.

  • Multiplemultiple nodes can be selected.
    • Multiple handle type:
      • Single : each node has its own individual position handle.

      • All : all nodes share the same position handle.

    • Unselect selected : clicking an already selected node will deselect it.

Max path width : global width of routes for all nodes (enable preview here, save global width here).
Connect with previous node : newly created node will connect to the previously created node.
Auto select connected node : node will be selected automatically after connecting to the source node.
Allow connect traffic node : on/off feature to connect to a TrafficNode.
Auto split connectionif a node is placed on an existing connection line, the connection will be split and reconnected through it (calculated via Raycast).
  • Disabled

  • Right angle : 90° angle.

  • Custom angle : custom user angle.

Auto rejoin line : if other nodes lie on the connection line, they will automatically be reconnected in series.
Auto attach to surfaceauto-attach created nodes to a surface.
  • Surface mask : layer mask for attachment.

  • Attach type:
    • Collider : attach to collider.

    • Mesh : attach to mesh.

Auto snap positionauto-snap node position during creation.
  • Snap value : snapping grid value.

Scene Settings

_images/PedestrianNodeCreatorSceneSettings.png
Show path : show pedestrian node routes.
Show path type:
  • All : show routes for all nodes.

  • Only created : show routes only for nodes created by this tool.

Show node buttonson/off display of custom buttons on selected nodes.
  • Node button type:
    • Delete : node will be deleted when clicked.

    • Unselect : node will be deselected when clicked.

Show unique info : displays unique node information (different from the original prefab).
Show reset custom route buttons : displays reset buttons for nodes with custom route widths.
Show border routes :
  • Current : route will be displayed using the assigned width of the nodes.

  • Selected : route will be displayed using the width selected in creator settings.

Show traffic node connection : on/off display of connections to TrafficNode.
Show selected node settings : shows node settings in the inspector.

Buttons

Create node : create preview node.
Add all scene pedestrian nodes : add all scene nodes to the creator.
Add all scene custom pedestrian nodes : add only nodes with custom widths to the creator.
Save global path width : change the route width for all nodes.
Reset all custom path width : reset route width to default value for all nodes with custom widths.
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 to grid [for selected node only, auto snap should be enabled].
Open advanced connection window : open Advanced connection window [for selected node only].

Hotkeys

_images/PedestrianNodeCreatorHotkeyConfig.png

Advanced Connection Window

Help window for advanced node connection settings.

Split Connection

Split an existing connection into several nodes.

_images/SplitConnection.png
Target pedestrian node : selected node where the split connections will be created.
Split count : number of new nodes created between the two selected nodes.
_images/SplitConnectionExample1.png _images/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.

_images/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 onto the line connecting the target nodes.
_images/JoinToConnectionExample1.png _images/JoinToConnectionExample2.png

Join to connection example 1.

_images/JoinToConnectionExample3.png _images/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.

_images/CreateCustomRouteWidth.png
Target pedestrian node 1 : target connected node of selected connection.
Custom route width : new width of custom route.
Offset from nodes : offset of newly created nodes from existing nodes.
_images/CreateCustomRouteWidthExample1.png _images/CreateCustomRouteWidthExample2.png

Create custom route width example.

Change Current Route Width

Set the custom width to the two selected nodes.

_images/ChangeCurrentRouteWidth.png
Target pedestrian node 1 : target connected node of selected connection.
Custom route width : new width of custom route.
_images/ChangeCurrentRouteWidthExample1.png _images/ChangeCurrentRouteWidthExample2.png

Change current route width example.