using System.Collections; using System.Collections.Generic; using UnityEngine; public class TrafficVehicle : MonoBehaviour { public float speed = 10f; void FixedUpdate() { transform.position += new Vector3(0, 0, speed + GameManager.movespeed) * Time.deltaTime; } void OnTriggerEnter(Collider other) { if(other.tag.ToLower().Contains("destroy")){ Destroy(gameObject); } } }