public GameObject gameObject;
void Update()
{
if (Input.GetMouseButton(0))
{
while (true)
{
yield return new WaitForSeconds(0.5f);
Instantiate(gameObject);
Destroy(gameObject, 2f);
}
}
}