Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Game Development How to Make a Video Game Pickups Add Pickup Particles

Diego Roda
Diego Roda
340 Points

Is there a way to destroy the particle system's game object from within the script that instantiates it?

ie: Something like calling the "destroy" method (with 5 seconds of delay) but in the next line after instantiating it (clearly, that would require referencing the effect game object from a script in another game object, but I'm not sure one can do that in Unity at this point in the course, so hence the question.

Annet de Boer
Annet de Boer
900 Points

I guess so; why don't you try it out :) I'm wondering though why you'd want to instantiate something you want to destroy immediately?