> For the complete documentation index, see [llms.txt](https://gley.gitbook.io/mobile-traffic-system/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gley.gitbook.io/mobile-traffic-system/setup-guide/waypoint-properties.md).

# Waypoint Properties

When a waypoint is clicked inside the scene the following window is opened inside the Settings Window.

<figure><img src="https://1500817731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuflU4iIzTBjoLH93zTYD%2Fuploads%2Fvs4xRTErmtvCt9mcWiIe%2Fimage_2024-02-07_135527304.png?alt=media&amp;token=9eba442e-f5aa-4e4e-b9bb-8b9497187f52" alt=""><figcaption><p>Edit Waypoint Window</p></figcaption></figure>

## Colors

The **green** rectangle is the selected waypoint.

The **blue** rectangles will be its neighbors (waypoints available to continue without any restrictions).

The **yellow** rectangles will be its previous (waypoints from which the current waypoint can be reached).

The **magenta** waypoint will be the other lanes' waypoint (waypoints from which a vehicle needs to make sure are free before going into them).

The colors can be modified using the color sliders at the top of the window.

## Position adjustments

By pressing **Select Waypoint** the Gameobject representing that waypoint is selected inside hierarchy and its position can be adjusted by moving its Transform.

<figure><img src="https://1500817731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuflU4iIzTBjoLH93zTYD%2Fuploads%2FmpivwPVvARidYA6UbSFv%2Fimage_2024-02-07_155611896.png?alt=media&amp;token=f34324fa-9610-4ab8-84b1-fa5bf3d110fb" alt=""><figcaption><p>Waypoint Selection</p></figcaption></figure>

This is useful to make small adjustments to the path.

## Giving Way

There are 3 types of giving way that can be configured at the waypoint level: Simple Give Way, Complex Give Way, and Zipper Give Way.

You can learn more about them inside [Setup Give-Way Waypoints](/mobile-traffic-system/setup-guide/setup-give-way-waypoints.md)section.

## Trigger Events

Sometimes during gameplay, you need some events if a vehicle reaches a particular waypoint.

Enable the Trigger Event checkbox and give it a name or a piece of meaningful information inside the data field as a string. That information will be passed to the event listener.&#x20;

Here is a simple example of how to subscribe and use those events:

```csharp
using Gley.TrafficSystem;
using UnityEngine;
public class Test : MonoBehaviour
{
    //a reference to vehicle pool and player assigned in inspector
    public VehiclePool vehiclePool;
    public Transform player;

    void Start()
    {
        API.Initialize(player, 20, vehiclePool);
        Events.onWaypointReached += WaypointReached;
    }

    /// <summary>
    /// Triggered every time a waypoint with Trigger Event box checked is reached
    /// </summary>
    /// <param name="vehicleIndex">the vehicle index that reached the waypoint</param>
    /// <param name="waypointIndex">the index of the waypoint</param>
    /// <param name="data">the data from the settings window</param>
    private void WaypointReached(int vehicleIndex, int waypointIndex, string data)
    {
        Debug.Log(vehicleIndex + " " + waypointIndex + " " + data);

    }

    private void OnDestroy()
    {
        Events.onWaypointReached -= WaypointReached;
    }
}
```

## Speed

Set the maximum speed allowed on this waypoint in km/h.

For more information on how to use this property see the [Speed Routes Setup](/mobile-traffic-system/setup-guide/speed-routes-setup.md) section.

## Spawn priority

Spawn priority represents how likely is for a vehicle to spawn on this waypoint. the higher the value the better the chances.

For more information on how to use this property see the [Waypoint Priority Setup](/mobile-traffic-system/setup-guide/waypoint-priority-setup.md) section.

## Waypoint penalty

Penalty is used only in pathfinding. A higher penalty will make this waypoint less likely to be included inside a path.

For more information on how to use this property see the [Path Finding Setup](/mobile-traffic-system/setup-guide/path-finding-setup.md#set-waypoint-penalties)section.

Allowed vehicles

Check or uncheck the vehicle types that are allowed to pass through this waypoint.

For more information about this see the [Vehicle Routes Setup](/mobile-traffic-system/setup-guide/vehicle-routes-setup.md)section.

## Add/Remove neighbors

Using the **Add/Remove Neighbors** or **Add/Remove Other Lanes**, you can manually add or remove connections from the selected waypoint.

<figure><img src="https://1500817731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuflU4iIzTBjoLH93zTYD%2Fuploads%2FXBD6Wy3BPuLsvmvqZJHU%2FV2-AddNeighbors.jpg?alt=media&amp;token=e19024e1-a105-4396-9bde-cb0c91eb2432" alt=""><figcaption><p>Add Neighbor</p></figcaption></figure>

When you press the **Add Neighbors** button, all available waypoints will be displayed inside the scene and you just need to **click** a waypoint to create a connection between the current waypoint and the clicked waypoint.

If a connection exists between two waypoints, if you select the destination waypoint, the connection will be removed.

When you are finished editing, just press the **Done** button inside the Settings Window.

To view a waypoint, press the **View** button and the scene camera will zoom in on that waypoint.

To delete a waypoint just press the **Delete** button from the Settings Window.
