using System.Collections; using System.Collections.Generic; using UnityEngine; public class SectionTriger : MonoBehaviour { public GameObject roadSection; public float speed = -100f; private void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("Trigger")) { Instantiate(roadSection, new Vector3(0, 0,other.transform.position.z + speed), Quaternion.identity); } } }