I’m trying to call the method SpawnRandom() every 3 second (starting from 1 second). When i press play the method doesn’t get called
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using TMPro;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class GameManager2 : MonoBehaviour
{
public static float loweBound = -7.4f;
public static float upperBound = 8.4f;
public bool gameover = false;
public TextMeshProUGUI gameov;
public Button RestartB;
public Button PauseB;
public Button ResumeB;
public GameObject[] prefab;
public float spawnX = 13.8F;
public float spawnYuP = 7.7F;
public float spawnYdW = -6.34F;
public float initial = 1.0f;
public float finale = 3.0f;
void start()
{
InvokeRepeating("SpawnRandom", initial, finale);
}
void Update()
{
}
public void SpawnRandom()
{
float rand = UnityEngine.Random.Range(spawnYdW, spawnYuP);
Vector3 v = new Vector3(spawnX, rand, 0);
Instantiate(prefab[0], v, prefab[0].transform.rotation);
Debug.Log("test call");
}