Нет задержки, объекты создаются сразу.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class cube : MonoBehaviour
{
// Start is called before the first frame update
public GameObject obj;
void Start()
{
}
// Update is called once per frame
void Update()
{
if (Input.GetKey(KeyCode.F))
{
StartCoroutine(inst());
}
}
IEnumerator inst()
{
while (true)
{
Instantiate(obj, new Vector3(0f, Random.Range(-10f, 10f), 0f), Quaternion.identity);
yield return new WaitForSeconds(1.0f);
}
}
}