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
0
Question by ratboy · Apr 13, 2012 at 05:55 PM · destroyparticle systemshuriken

shuriken auto destruct script doesn't ALWAYS work?

Hi, after looking around on the net i found this code :

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

to destroy particle systems instantiated ingame, the majority of the time the code does as it should, but every odd runtime, (even if i haven't changed the scene in any way), it will still show the 6 white circles when the particle system ends, is there a more solid code?

Comment
Add comment · Show 6
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 badProphet · Apr 13, 2012 at 06:13 PM 0
Share

Does the particle system still appear in the hierarchy? Have you tried attaching the particle system to an empty game obj?

avatar image ratboy · Apr 13, 2012 at 06:17 PM 0
Share

well when the autodestruct doesn't work it still shows up in the hierarchy for a little longer, as if there is a delay on the autodestruct, but there is nothing telling it to delay, and its completely random whether or not it autodestructs on time or waits a few seconds.

avatar image Datael · Apr 13, 2012 at 06:39 PM 0
Share

Have you tried setting it as inactive after destroying it? The object will definitely live on until at least the end of the frame.

avatar image ratboy · Apr 13, 2012 at 06:50 PM 0
Share

in the same function?

avatar image Datael · Apr 13, 2012 at 06:55 PM 0
Share

Yes; directly after it and recursively. It might help. Not 100% sure, though...

Show more comments

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by ratboy · Apr 19, 2012 at 10:28 PM

Really silly - crossing over assets from a PC to a mac, and the Unity Explosion Framework doesn't support IOS, lesson - always read the small print.

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
avatar image
0

Answer by IndieForger · Feb 17, 2013 at 04:24 AM

Consider moving LateUpdate check to external controller. You might gain a little performance. I wrote full explanation in article: Auto destroying particle system in unity3d

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

7 People are following this question.

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

Related Questions

Two objects are placed at the same place. How to destroy one and keep another? 1 Answer

Particle system - dissapeared with camera angles -1 Answers

How to pause emitter in new Particle System? 2 Answers

Why are all the particles in my particle system disappearing when it's off screen? 1 Answer

Set Particle lifetime by distance, not time? 2 Answers


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