If a vehicle detects a collider and that collider is destroyed by another script, the OnTriggerExit method is not automatically triggered. In such cases, this method needs to be manually invoked to remove the obstacle in front of the traffic vehicle.
usingGley.TrafficSystem;usingUnityEngine;publicclassTest:MonoBehaviour{ //a reference to vehicle pool and player assigned in inspectorpublicVehiclePool vehiclePool;publicTransform player;voidStart() {API.Initialize(player,20, vehiclePool); }publicvoidDestroyObstacle() {GameObject obstacleToDestroy =GameObject.Find("SomeObstacle");Collider collider =obstacleToDestroy.GetComponent<Collider>();API.TriggerColliderRemovedEvent(collider);Destroy(obstacleToDestroy); }}