DisableAreaWaypoints

Description

Disables all the waypoints from a given circular area defined by its center and radius. Vehicles will not be able to cross over these waypoints and will not instantiate on top of disabled waypoints.

Declaration

public static void ClearTrafficOnArea(Vector3 center, float radius)

Parameters

NameDescription

center

The center of the circle to disable waypoints from.

radius

The radius in meters of the circle to disable waypoints from.

Example

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);
    }

    public void DisableWaypoints()
    {
        //disable all waypoints 20m around the player 
        API.DisableAreaWaypoints(GameObject.Find("Player").transform.position, 20);
    }
}

Last updated