Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 hawkwood · Jan 07, 2016 at 01:12 PM · scripting problemparticle systememit

Particle System fails to emit() after last particle dies

Version of Unity: 5.3.1f1/p1

I have a particle system that needs to emit bursts of particles on irregular periods, so I was doing this though script. This works fine while the period is less than the particle lifetime since the last emit (meaning there are still active particles), but if this period is greater than that, the system does not emit and does not throw an error.

I verified this is the case with a simple scene that just contains a single particle emitter (I used the default) with the startLifetime set to 1.0 and emission turned off, then I added the following script component:

 using UnityEngine;
 using System.Collections;
 
 public class TestingPSDelay : MonoBehaviour {
 
     private ParticleSystem ps;
 
     private float dt = 0.0f;
     private float ed = 0.5f;
     // Use this for initialization
     void Start () {
         ps = GetComponent<ParticleSystem> ();
     }
     
     // Update is called once per frame
     void Update () {
         dt += Time.deltaTime;
         if (dt >= ed) {
             dt -= ed;
             ed += 0.1f;
             ps.Emit (1);
             Debug.Log ( "Next ed = " + ed );
         }
     }
 }
 

The console output is as expected with "ed" slowly growing, but after "ed" > 1.0, the system no longer emits particles even though the console output continues.

Pretty sure this is a bug.

Comment
Add comment · Show 3
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 TriBolt72 · Jan 08, 2016 at 04:27 AM 0
Share

Have you tried ps.Clear (); to reset the particle system? Then after it is reset, you should be able to continue the process. Just something to work with maybe...

avatar image Mischa · Jan 08, 2016 at 10:44 AM 0
Share

I have the same problem. ps.Clear() doesn't seem to work, still no emitting. The Emit() did work before the update to 5.3.1p2 though.

Just sent a bug report about it to unity. If anyone has any workarounds this would be awesome :)

avatar image TriBolt72 · Jan 08, 2016 at 11:44 AM 0
Share

Very strange... The only way around this that I can think of is creating a prefab with your particle system and play on awake selected then instantiating it in whenever you need it... Not really optimal but could be "okay" with object pooling. Hope somebody finds something a little more concrete!

3 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by Mischa · Jan 08, 2016 at 04:57 PM

I submitted an issue for this problem to Unity. That's the answer I got from support:

Hey,

Thanks for reporting the issue.

We have fixed this and problem should not appear in the latest version of Unity 5.4, which is currently in beta. You can download it here.

[...]

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 TriBolt72 · Jan 08, 2016 at 07:32 PM 0
Share

Good to know!

avatar image
1

Answer by hawkwood · Jan 10, 2016 at 07:16 AM

The workaround I found was to change "Simulation Space" from Local to World, and luckily in my situation that is an acceptable solution.

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 firebirdgames · Jan 18, 2016 at 07:00 AM 0
Share

It worked for me too. Thanks!

avatar image
1

Answer by furibaito · Jan 14, 2016 at 12:06 PM

I've found a temporary workaround for my project, by overriding the startLifetime each time emit() is called.

 ParticleSystem.EmitParams emitOverride = new ParticleSystem.EmitParams();
 emitOverride.startLifetime = 0.25f;
 ps.Emit(emitOverride, 1);
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 avclubvids · Apr 24, 2016 at 05:14 AM 0
Share

This answer is the holy grail – EmitParams is so incredibly poorly documented. Thank you @furibaito for saving my sanity!

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

8 People are following this question.

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

Related Questions

[Newbie] Particle System not playing, C# (unity 5.5) 3 Answers

Particle system won't restart emitting before last particle has died 3 Answers

How to Instatiate a particle system on a moving object 2 Answers

How can I make particles apeear in exact position? 0 Answers

How do I change the velocity over lifetime value on a Particle System using a slider? 0 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