using System.Collections; using UnityEngine; using static UnityEngine.UIElements.UxmlAttributeDescription; public class MeteorRain : MonoBehaviour { [SerializeField] private GameObject Meteorite; IEnumerator Start() { while (true) { yield return new WaitForSeconds(3f); Create(); } } void Create() { GameObject meteor = Instantiate(Meteorite, transform.position, transform.rotation); meteor.GetComponent().linearVelocity = new Vector3(Random.Range(-10.0f, 10.0f), Random.Range(-10.0f, 0f), 0); } }