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 jyfc · Oct 23, 2017 at 02:29 PM · particlesunityeditorparticlesystemparticle system

Is it possible to attach your own scripts to particle system particles, or add behaviour in other ways?

I'd rather not create a custom system from scratch, so the particle system seemed like a cool way to emit particles with all those options, that have behaviour as well.

They let us change physics related aspects of emitted particles and give us access to the collision function, but I can't seem to find a way to actually specify behaviour (with a script component for example).

A simple example case where I'd use this:

I turn physics on in the particle system. When the particle is created I keep track of when it was created.

Now when it hits some target object I simply read that value. The target object may be moving around so the order of particles hitting/being collected isn't guaranteed.

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

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by WinterboltGames · Oct 23, 2017 at 02:40 PM

Yes, you can! check out this part of this doc (it's a ton of help!)

https://docs.unity3d.com/ScriptReference/ParticleSystem.html

There's a property in the ParticleSystem called ParticleSystem.main with it, you can access all (literally all) of the particle system properties and behaviors and change them at runtime!

hope this helps.

Comment
Add comment · Show 4 · 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 jyfc · Oct 23, 2017 at 02:52 PM 1
Share

So in my example how would I attach a script to each particle generated by the particle system?

avatar image WinterboltGames jyfc · Oct 23, 2017 at 02:57 PM 0
Share

Sorry, but I didn't get your question right in the first time do you want to attach a script to Every single particle? kinda crazy if you ask me because i think it's impossible, the method above works with particle systems, not particles themselves.

avatar image WinterboltGames WinterboltGames · Oct 23, 2017 at 02:59 PM 0
Share

also, think about the performance impact if you have 5 particle systems each emitting 500 particles/$$anonymous$$ and executing functions at the same time! you might get -100 fps!

Show more comments

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

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

Best way to create underwater particles with best possible performance? 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

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