I don’t know what I am doing wrong but every single time I have tried to script something I always get an error and some the colors of the text does not show up the same as the tutorials I am following.
I am getting “error CS1002: ; expected” with this script
using System.Collections;
using UnityEngine;
public class Guncontroller : MonoBehaviour
{
[header("Gun Settings")]
public float fireRate = 0.1f;
public int clipSize = 30;
public int reservedAmmoCapacity = 270;
//Variables that change throughout the code
bool _canShoot;
int _currentAmmoInClip
int _ammoInReserve;
private void Start()
{
_currentAmmoInClip = clipSize;
_ammoInReserve = reservedAmmoCapacity;
_canShoot = true;
}
private void update()
{
if(input.GetMouseButton(0) && _canShoot && _currentAmmoInClip > 0)
{
_canShoot = false;
_currentAmmoInClip--;
StartCoroutine(ShootGun());
}
}
IEnumerator ShootGun()
{
yield return new WaitForSeconds(fireRate);
_canShoot;
}
}