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 /
This post has been wikified, any user with enough reputation can edit it.
avatar image
1
Question by superflyninja · Dec 17, 2013 at 02:17 PM · androidprefabparticle system

Is it worth object pooling two particle systems?

Hi all, Im aiming to release a simple kids matching game on android. When a match is made an instance of a particle system prefab is created at both positions of the matched objects. Is it worth creating two PS's and resetting and re positioning for each match? My prefab fires all particles at once. So how would I reset it?

cheers

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

2 Replies

· Add your reply
  • Sort: 
avatar image
4

Answer by TwisterK · Dec 17, 2013 at 02:51 PM

if you plan to release on mobile platform, it is always recommend to use pooling as Instantiate and destroy objects often cause performance spike on the device.

To implement pooling, all you have to do is instantiate the two objects during awake, then set game object to inactive. When you want to use it, just re-activate it and call Play method ( if you using shuriken system ) to emit the particle, once you done with the particle, call Stop and Clear method and de-active the game object.

Here are the sample code to Play the particle system.

Play Method

Stop Method

Clear Method

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
3

Answer by Owen-Reynolds · Dec 17, 2013 at 03:00 PM

Reset with the Play command: PS1.particleSystem.Play();. Uncheck the Loop box so it fires once, then never again, so won't have to stop it. But you could still have a coroutine SetActive(false) after 5 seconds, if you're really worried.

But, will they ever make a new match while the old is still fading away? Then you'd want extra particlesystems. In that case, the game is probably fast enough that you can just Instantiate/Destroy.

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 superflyninja · Dec 18, 2013 at 09:54 AM 0
Share

There probably could be another match made while the first particles are still fading. But i dont see that as being much of an issue. The new explosions should distract the player. If it doesnt look right I can just use 4 particle systems. Thanks for the answers :D

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

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

Related Questions

Calendar not showing when installing from apk 0 Answers

Particle System glitch on Android phone. 0 Answers

Android Build help needed regarding ball throw 1 Answer

cannot load GameObject Prefabs using Resources.Load in Android 0 Answers

How to destroy a particular clone on touch/mouse? 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