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 LaurensiusTony · Jul 07, 2014 at 09:11 AM · particlesystempooling

pooling particle system

Hi, i wondering how to make a particle system pooling? since my game use same particle system (eplosion) multiple times, so maybe there is a way to reuse the particle system and not destroying and instantiate a new one every time.

right now i using this but i have no idea how to change it to do pooling

 private ParticleSystem instantiate(ParticleSystem prefab, Vector3 position)
     {
 
         ParticleSystem newParticleSystem = Instantiate(
             prefab,
             position,
             Quaternion.identity
             ) as ParticleSystem;
 
         //make sure it will be destroyed
         Destroy(
             newParticleSystem.gameObject,
             newParticleSystem.startLifetime
             );
 
         return newParticleSystem;
     }
Comment
Add comment · Show 1
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 Shark-Boy · Aug 11, 2014 at 09:00 PM 0
Share

You could try modifying one of these scripts for particle systems. $$anonymous$$aybe just change GameObject to ParticleSystem, or attach your particle system to a game object?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Forsh · Feb 05, 2016 at 04:39 PM

I've been trying to get this working too lately but have hit a snag. I used ParticleSystemDestroyer.cs as the basis for a new class ParticlePoolManager.cs, which I attach to the particle systems (and remove the original). Instead of destroying particle systems it uses a PoolManager object I created and put in the scene, which stops them and shoves them into a List. On requesting a new instance of that particular particle (via the PoolManager) it will check the pool first and use that instance if one exists, and re-positions/restarts the PS.

This works for non-nested particle systems but fails when there are more than one within the prefab being pooled.

I would be interested to hear if anyone else has had success recursing through nested particle systems and pooling them as a single object to be reused.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Coding A Tornado Particle Effect 0 Answers

Shiruken Particle System and Scripting 0 Answers

How can I play a sound every time a particle is emitted? 3 Answers

Copy values from one object (scriptwise) to another 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