using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class VehicleController : MonoBehaviour
{
    private Transform vehicle;
    public float VehicleSpeed;

    void Start()
    {
        vehicle = this.transform;
    }

    void Update()
    {
        Vector3 pos = vehicle.position;
        pos.x -= VehicleSpeed;
        vehicle.position = pos;
        if (pos.x < -20) Destroy(gameObject);
    }
}
