InvokeRepeating is an extension of invoke: if you want to execute something after a delay, and then every x seconds void Start()
{
InvokeRepeating("SpawnObject", 2.0f, 1.0f);
}
void SpawnObject()
{
float x = Random.Range(-2.0f, 2.0f);
float z = Random.Range(-2.0f, 2.0f);
Instantiate(target, new Vector3(x, 2, z), Quaternion.identity);
}