Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How do I continuously shoot with delay?

using System.Collections;

using System.Collections.Generic;

using UnityEngine;


public class Weapon : MonoBehaviour

{

    public Transform firePoint;

    public GameObject bulletPrefab;


    void Update()

    {

        if (Input.GetButtonDown("Fire1"))

        {

            Shoot();

        }

    }


    void Shoot ()

    {

        Instantiate(bulletPrefab, firePoint.position, firePoint.rotation);

    }

}

Sign In or Register to comment.