Deleting all child clones in a GameObject

Like the picture below. How can I delete/destroy all of the Particle(clones) in those GameObjects when I press the “F” button ?

alt text

Event Flow:
If I click those “GameObj” the “Particle(Clone)” will appear and then if I press the “F” button those clones must/should be deleted/destroyed

You could do something like that:

// C#
public class SomeObject : MonoBehaviour
    public Transform particleEffect;
    void OnMouseDown()
        var clone = (Transform)Instantiate(particleEffect);
        clone.parent = transform;
        clone.localPosition =;
        clone.localEulerAngles =;
    void Update()
            for(int i = transform.childCount-1; i>=0; i--)


Attach this script to all of your “GameObj”. If you have a different way of creating the particle effects, please include your script in your question.