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 Davidflynn · Mar 04, 2012 at 03:11 PM · colliderparticles

Turn Invisable Collider off and on

Im wanting to turn an invisable cylender colder I have place off and on. and I also need to toggle my particle emiter off and on for fire I have never called the off and on swich befor so I was hoping some one could provide me some help.

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
Best Answer

Answer by Peter G · Mar 04, 2012 at 03:51 PM

Unity makes it really easy to turn a component on and off. Most components have a property enabled that turns them active/inactive.

  //Example:
  function Start () {
        InvokeRepeating("FlipCollider" , 3 , 3);
        //Call every 3 seconds.
  }
  function FlipColider () {
        collider.enabled = !collider.enabled;
        //flips the current value.  Makes it the opposite of what it currently is.
        //Most components either have an enabled or active(obsolete) property.
 
        particleSystem.enableEmmission = !particleSystem.enableEmmission;
        //The new Shuriken system has a slightly different name for enabled though.
  }
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 Davidflynn · Mar 04, 2012 at 04:02 PM 0
Share

I cant get it to make the flame ver die for the 3 seconds i have found another code that works but i cant manage to get it to work as a loop.

// Emit particles for 3 seconds particleEmitter.emit = true;yield WaitForSeconds(3); // Then stop particleEmitter.emit = false;

avatar image Peter G · Mar 04, 2012 at 06:10 PM 0
Share

Oh your using the legacy particle emitter. Just replace the your line for the last line of instructions in $$anonymous$$e.

avatar image Davidflynn · Mar 04, 2012 at 06:30 PM 0
Share

I have place it just like this on the innerCore and outterCore of my fire particle effect and it never makes it change.

function Start () { InvokeRepeating("FlipCollider" , 10 , 10); //Call every 3 seconds. } function FlipColider () { collider.disable = !collider.disable; //flips the current value. $$anonymous$$akes it the opposite of what it currently is. //$$anonymous$$ost components either have an enabled or active(obsolete) property.

    particleEmitter.emit = false;yield WaitForSeconds(10); 
    
    }
avatar image Peter G · Mar 06, 2012 at 11:47 PM 1
Share
  1. your not flipping anything. Flipping is setting it to equal the opposite of itself. You're just setting emit to false. You need to do:

    particleEmitter.emit = !particleEmitter.emit;

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

particle colliders 1 Answer

Make collider behave like a trigger without isTrigger 1 Answer

Internal collisions 1 Answer

Using different paricle emitters depending on the tag of the object raycast hits? 1 Answer

Particles colliding inside of a mesh 0 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