About 'How To Destroy Particles'!

In this video (objectives)…

  1. Finish our ring buffer
  2. Discuss how to destroy particle systems
  3. Use Unity's Destory(object, delay) function

After watching (learning outcomes)…

Destroy instantiated particle effects when they have finished playing.

(Unique Video Reference: 35_RR_CU2)

We would love to know…

  • What you found good about this lecture?
  • What we could do better?

Remember that you can reply to this topic, or create a new topic. The easiest way to create a new topic is to follow the link in Resources. That way the topic will…

  • Be in the correct forum (for the course).
  • Be in the right sub-forum (for the section)
  • Have the correct lecture tag.

Enjoy your stay in our thriving community!

Hi Ben

This lesson is not playing and jumps to the first lesson of TileMap. I notice the lesson shows 0, perhaps that’s why. I am sure you would have noticed but just in case.

Tej

1 Like

You can actually specify a parent transform directly while instantiating:
Instantiate(gameObject, position, rotation, parentTransform);

4 Likes

I called the following method in the Start method of my EnemyDamage (and similar in TowerFactory) script:

private void vfxParentCheck()
{
    if (vfxParent = GameObject.Find("VFX")) // if an object with name "VFX" is found...
    {
        return;  // carry on.
    }
    else vfxParent = new GameObject("VFX");  // Otherwise, create an empty gameobject with that name
}

Then I set the parent as per the video.

I didn’t go forward with the suggested way of destroying particles, instead I used the solution from a previous discussion forum post (disabling loop and setting destroy for the stop action within the particle settings).

Reason why I went this way? It seemed more intuitive to have the particle system take care of itself.

I have also chosen this approach @Michael_Hiatt for the same reasons.
Less clutter in the hierarchy and like you said, the particles seem to take care of themselves :slight_smile:

1 Like

Privacy & Terms