Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 question was closed Nov 16, 2017 at 04:34 PM by $$anonymous$$ for the following reason:

The question hasn't any answers and doesn't make any sense.

avatar image
0
Question by $$anonymous$$ · Aug 19, 2017 at 12:20 PM · particlesparticlesystemparticle systemdynamiclifetime

Dynamic Particle System Lifetime??

I Have Tried Changing Lifetime Of A Particle System Dynamically Via Script, But It Seems Like Unity3D Doesn't Have A Way Or A Function To Do This, So I Have Tried 2 Ways, Which I Have Expected ParticleSystem.main.startLifetime Doesn't Work Before Testing It:

 main.startLifetime = 2.5f;

And:

 particle.time = main.startLifetime.constant * 0.8f;

Both Of Them Won't Work, So Is There A Way To Do That?
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

2 Replies

  • Sort: 
avatar image
0

Answer by Komayo · Aug 19, 2017 at 03:19 PM

 particleSystem.startLifetime = 1.2f;    // 1.2 seconds

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 $$anonymous$$ · Aug 19, 2017 at 04:09 PM 0
Share

I Have Gave The Same Script Above And Said That It Won't Work, But You Gave $$anonymous$$e The Same Thing :D , startLifetime Isn't Dynamic, It Only Affects The Particle System When It Plays Or Emits, Not During The Lifetime! What I Want Is The Particle System Gets Instantiated And When An (if) Statement Returns True, I Want The Particle System To Reduce Its Lifetime! Not To Wait Its Original startLifetime Parameter Until The Particle Fades Out!
But Anyway.. Thanks :)

avatar image
0

Answer by ifurkend · Aug 19, 2017 at 05:25 PM

To access the "remainingLifetime" of particles, you need to getParticles, modify each particle in the loop then setParticles. Simply follow the code example in the doc: https://docs.unity3d.com/ScriptReference/ParticleSystem.GetParticles.html

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 $$anonymous$$ · Aug 20, 2017 at 11:47 AM 0
Share

No I Don't Want To Access Remaining Lifetime, I Want To To Change The Lifetime During The Emit Of The Particle, For Example:
The Particle System By Default In The Prefab Has 20 Seconds StartLifetime, And After Getting Instantiated, Let's Say I Have A Button, And When I Press It, I Want To Reduce The Lifetime Of The Particle System, So Let's Say 10 Seconds Passed, Then I Pressed The Button, So I Want To $$anonymous$$ake The $$anonymous$$aximum Lifetime Of The Particle 12.5 Or 15 Seconds Ins$$anonymous$$d Of The Original 20 Seconds When Gets Instantiated!

avatar image Rafaelski · May 26, 2020 at 03:20 PM 0
Share

Thanks man! That's e really good tip. Help me a lot :)

Follow this Question

Answers Answers and Comments

74 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 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 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 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

Assign random start lifetime for particle system from script 2 Answers

Is there a way to determine what mesh(es) are used by the particle system when multiple meshes are assigned? 0 Answers

I want to pause and clear a particle system and be able to start it again, but I am using the Sparkle Rising particle which has no Particle System? 1 Answer

How to destroy / hide a single particle? 2 Answers

Smoke Particle Not Playing Continuously 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