For the complete documentation index, see llms.txt. This page is also available as Markdown.

GetVehicleState

Description

Get the current DriveActions of the specified vehicle.

Declaration

public static DriveActions GetVehicleState(int vehicleIndex)

Parameters

Name
Description

vehicleIndex

The index of the vehicle.

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 GetVehicleState()
    {
        Debug.Log($"Vehicle with index 0 is in state: {API.GetVehicleState(0)}");
    }
}

Last updated