Im trying to spawn pipes at (20,0,0) every second after two seconds but It wont work.
it doesnt give any errors or feedback so I dont know what im doing wrong
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SpawnManager : MonoBehaviour
{
public GameObject[ ] PipePrefabs;
public int PipeIndex;
public float SpawnInterval = 1;
public float startDelay = 2;
// Start is called before the first frame update
void Start()
{
InvokeRepeating(“SpawnRandomPipeType”, startDelay, SpawnInterval);
}
// Update is called once per frame
void SpawnRandomPipeType()
{
if (Input.GetKeyDown(KeyCode.S))
{
int PipeIndex = Random.Range(0, 10);
Instantiate(PipePrefabs[PipeIndex], new Vector3(20, 0, 0), PipePrefabs[PipeIndex].transform.rotation);
}
}
}