How do you destroy clones of a particle?
In my game i have a particle that gets instantiated when the player double jump, however every time this happens a clone of the particle is made so how do I remove them.
void Update()
{
if ((grounded || !doubleJump) && Input.GetButtonDown("Jump"))
{
rigidbody2D.velocity = new Vector2(rigidbody2D.velocity.x, 0);
rigidbody2D.AddForce(new Vector2(0f,jumpForce));
audio.Play();
if (!grounded && Input.GetButtonDown("Jump"))
{
Instantiate(particle,transform.position, transform.rotation);
}
This is the part of the code where the particle is instantiated.