I was making a 2d game using one of Brackey’s tutorials and came across 3 errors
CS1519 - Invalid token ‘=’ in class, struct, or interface member declaration
CS1514 - { expected
CS1513 - } expected
this is my script:
using UnityEngine;
public class Spawner : MonoBehaviour
{
public class SpawnRate = 1f;
public gameObject hexagonPrefab;
private float nextTimeToSpawn = 0f;
// Update is called once per frame
void Update()
{
if (Time.time >= nextTimeToSpawn)
{
Instantiante(hexagonPrefab, Vector3.zero, Quaternion.identity);
nextTimeToSpawn = Time.time + 1f / SpawnRate;
}
}
}