• 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
0
Question by Kaboom · Feb 03, 2015 at 12:19 AM · particle systemshurikenscriptingproblem

How to script Shuriken ParticleSystem.Simulate() to emulate editor behaviour

I'm making a "time vortex"/hyperspace/trippy particle tunnel sort of effect, and while playing with the particle system settings in the editor I've found an effect I quite like. Now, I'm trying to replicate the visual effect at runtime.

What I did: I've set up a Shuriken particle system, emitting from the base of a cone, with a forward acting force-over-lifetime, so the particles form a tunnel of sorts. I got the effect I liked by decreasing, in the editor, the start speed variable. This "squeezes" the tunnel and gives it a focal point once the particles intersect. Further decreasing the speed (into the negatives) gives a nice "passing through the particle cloud, breaking through to the other side" effect.

Now, this works because changing the speed in the editor "backdates" and updates all particles, putting them at the location they would have had, if they had been emitted with those values.

I can easily script or animate the decreasing start speed, but of course at run time, this only affects new particles, emitted after the change. So, now I'm trying to use ParticleSystem.Simulate(Time.time, true, true) to re-simulate the particle system, using the changed speed. It kinda works - but it breaks after Time.time becomes greater than the particle's life time. Then, the particles freeze in place and kind of stutter back and forth a bit. I've added system.Stop() and system.Clear() but this doesn't seem to have any effect. The documentation on these function is extremely sparse, so I was hoping someone can tell me either how to achieve what I'm trying to do, or confirm that it's not possible (for example, because Simulate() just won't work for durations longer than a particle's lifetime).

I've added some screenshots, but it's hard to get the effect across as static images. Still, maybe they'll give you a clue!

initial

time-vortex-start.png (230.6 kB)
time-vortex-squeeze.png (198.6 kB)
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

0 Replies

· Add your reply
  • Sort: 

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

Remove wireframe on particle systems 3 Answers

Whats the best way to create a 'legacy' particle system? 1 Answer

Rotation of particle system (Shuriken) 1 Answer

Shurkien particle system shadows 0 Answers

Colliding particles acting strange near/in colliders in unity 5 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