neon_run/Assets/Scripts/TrafficVehicle.cs
2025-11-13 22:37:47 +05:30

21 lines
460 B
C#

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);
}
}
}