Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by wolventoad · Apr 20, 2012 at 07:42 AM · particleunity3.5

How To destroy a particle system in Unity 3.5

I have updated my Unity to 3.5, and unfortunately I never got used to the new Particle System, that I can't find the "Auto Destruction" option...

can anyone tell me how to destroy a particle when it finished playing? Thanks!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

4 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by Karsten · Apr 23, 2012 at 12:00 AM

Add a script to the Particlesystem and in that script alter the Update function so that it looks like this

function Update () { if (!particleSystem.IsAlive()) Destroy (gameObject); }

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ViNull · Apr 17, 2013 at 02:22 AM 0
Share

I would vote this up, but I'm not allowed - thanks for the answer!

avatar image
1

Answer by yusufulutas · Apr 20, 2012 at 08:55 AM

Unfortunately new particle system don't have auto destruction but if you close looping,your particle becomes disable. maybe this can help you.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image wolventoad · Apr 20, 2012 at 09:21 AM 0
Share

Thanks, still I wanna ask is, is there any way I can detect whether the particle has finished and destroy it on script?

avatar image huahsin68 · Aug 18, 2013 at 06:42 AM 0
Share

This solution isn't effective because when closing the looping feature making the particle system invisible, will this cause the system taking up resources? I don't know how Unity3d engine handle this? Will the engine auto dispose just like JV$$anonymous$$?

avatar image
0

Answer by citizen_rafiq · Oct 27, 2012 at 12:27 AM

if you want to destroy previous example is enough but if you want to reuse it again and again without creating clone object then you don't need to Instantiate or destroy it just play it, where and when you want :)

1.unchecked looping from particle system editor 2.create a transform variable in your script as public(example explosionTrans)and set your particle object from editor. 3.now in your update method

explosionTrans.particleSystem.transform.position=this.transform.position; explosionTrans.particleSystem.Play();

particle object will follow your game object position which is assign by you this script

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Devil_Inside · Dec 29, 2012 at 08:56 PM 0
Share

For some reason this doesn't work as intended. If I try to create 3 explosions at once, some of the explosions just won't show up randomly. Sometimes it creates all 3, sometimes just 2, sometimes none. They're either created at the same position and I can't spot that, or they're not created at all.

avatar image citizen_rafiq · Aug 18, 2013 at 12:13 PM 0
Share

Recently i am using different way to make group particle explosion.1.I create a empty game object and make it as parent of all explosion that I wanted to be grouped named root_exp_grenade. 2.when a grenade droped on the ground I take the landing position and Instantiate root_exp_grenade and boom (GameObject go = Instantiate(root_exp_grenade,transform.position, Quaternion.Euler(Vector3.zero)) as GameObject; ) 3.there is script attached with root_exp_grenade and it destroy the object after a fixed time, you can load root_exp_grenade form resource or set it from Assets in a public var. You can also Instantiate a fixed number of root_exp_grenade first and pooling them and active them using SetActiveRecursively(true) and inactive them using SetActiveRecursively(false).

avatar image Rakeshchatra · Aug 27, 2013 at 12:11 PM 0
Share

you can destroy it with Destroy(gameObject , sometime); this sometime can be any integer depending on after how many seconds you want to destroy the particle system.

avatar image
0

Answer by huahsin68 · Aug 27, 2013 at 12:40 PM

I have come across the similar problem before, this is how I solved it. In particle system you have created, check whether you have Particle Animator component install into the particle system, if not it is accessible through Component > Effects > Legacy Particles, you should see the autodestruct option rigth inside this component.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Water emission using c# 1 Answer

Problem with changing color of particles 3 Answers

particleSystem.Play(); wont start 1 Answer

Particle system not moving 0 Answers

Make particle interact with colliders 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges