Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 jacobschellenberg · Nov 09, 2013 at 06:12 PM · collisionparticle systemparticle collisionprogrammatically

Programmatically Enable/Disable Shurikan Particle Collision Module

I'm expecting there to be a:

 myParticleSystem.GetComponent<ParticleSystem>().CollisionModule.Enabled = false;

but unfortunately there isn't, in fact, I can't seem to programmatically access any of the particle modules. So far the only way I can enable/disable collision is by manually clicking the Collision Module > Enabled property in the inspector. Essentially what I'm looking for is to have an option for the player to enable/disable particle collision, for performance reasons

I've considered using two different particle systems, the only difference being one has the Collision Module enabled, and the other doesn't. That however seems kind of ridiculous, considering there is a checkbox for it right there on the ParticleSystem Module......

Any ideas?

Thanks!

alt text

screen shot 2013-11-09 at 11.06.56 am.png (25.3 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

3 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by roberto_sc · Feb 20, 2017 at 01:46 AM

Do this:

     ps = GetComponent<ParticleSystem>();
     var collision = ps.collision;
     collision.enabled = false;

Like stated in the documentation.

Notice that that is different than doing this:

     ps.collision.enabled = false;
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 thetruesthfan · Aug 06, 2018 at 02:56 PM 0
Share

Thank you so much dude!

avatar image
-1

Answer by Sundar · Nov 10, 2013 at 06:00 PM

Did you try this

 myParticleSystem.GetComponent<CollisionModule>().Enabled = false;
 
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 jacobschellenberg · Nov 10, 2013 at 06:25 PM 0
Share

I don't believe there is a Collision$$anonymous$$odule class to do that. I may be mistaken, bit I thought I've tried that.

avatar image
0

Answer by IgorIvanov · May 08, 2014 at 10:31 AM

So badly... Unfortunately there is no any way to get CollisionModule (and others) from script that will be compiled. For example, I need in planes for CollisionModule to restrict my particle rays PROGRAMMATICALY!

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

20 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

Related Questions

Spawning particles inside of collider 0 Answers

How to keep particles moving past an obstacle after they have collided with it? 3 Answers

How to detect which exact particle element from a particle system hit a collider? 0 Answers

ParticleSystem collision checking. 2 Answers

Particle collision radius origin is offset to the left. How can I make it centered? 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