I am trying to make the gun in my game have a delay when shooting and also keep shooting when holding down the Mouse Button – But i got the Error CS0116 when trying to save the script in Unity.

It says there is an error in line 19, Character 10 if that helps

Thanks for helping!

This is my script:

using System.Collections.Generic;
using UnityEngine;

public class Bullet : MonoBehaviour {

    public float speed = 12f;
    public Rigidbody2D rb;
    public float fireRate = 0.5F;
    private float nextFire = 0.0F;

    // Start is called before the first frame update
    void Start()
        rb.velocity = transform.right * speed;
    void Update()
    if (Input.GetButton("Fire1") && Time.time > nextFire)
        nextFire = Time.time + fireRate;
        GameObject clone = Instantiate(projectile, transform.position, transform.rotation) as GameObject;
Anonymous Asked question May 13, 2021