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
2
Question by Recluse · Sep 14, 2015 at 01:14 PM · particlesystemparticle systemshuriken

Set Particle lifetime by distance, not time?

It seems like particle lifetime is time dependent. Is there a way to kill a particle after it has traveled X meters? I want to use particles to represent information travelling between nodes. The nodes could be any distance apart and I want the particle to die when it reaches its destination, however I don't want to use collisions for this id possible.

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
1

Answer by Recluse · Sep 14, 2015 at 01:31 PM

Thanks, I'd need multiple objects though if I needed 25 nodes to be simultaneously transmitting particles.

I have a single particle system which handles unlimited nodes emitting particles, and it's fine apart from one thing - the particles sometimes overshoot the receiver nodes - because their lifespan is determined by time, not by distance.

I know the positions, etc of everything. But I'm not sure how to tell a particle to die after 25 meters.

I could use OnParticleCollision() but it would be far simpler if I could just tell each particle to die after X meters. I was thinking if I know how fast they move, I could work out the time it will take a particle to travel X meters and set the lifetime accordingly. But I can't find in the docs what particle speed is (i.e. if it's measured in meters per second)...

This seems to work:

 Emitter.startLifetime = Vector3.Distance(Emitter.transform.position,target.position)/Emitter.startSpeed;





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 Navarrox · Feb 24, 2018 at 07:42 AM 0
Share

I know this is a really old QA but i just wanted to thank you! This simple equation saved me a ton lol.

avatar image
0

Answer by garamanx · Nov 18, 2020 at 04:23 PM

@Recluse thanks! still saving my and other lives in the 2020's :D

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

29 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

Related Questions

ParticleSystem Rate over Distance doesn't work until poked 1 Answer

Shuriken collision with terrain? 0 Answers

Emulate Editor's Particle Scrubbing Functionality in Game 1 Answer

Multiple trails behind one particle? 1 Answer

Particle system ends with shuriken graphic 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