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 hardmode2236 · Dec 10, 2014 at 09:55 PM · transformparticlescoroutineparticlesystemdistance

moving a disabled particle system that's set to distance emission

no matter how hard i disable this particle system it still emits particles in a line when i move its transform.

heres my code:

     function load()
     {
         boltParticles.emissionRate=0;             // try to stop it from emitting by making it not emit.
         boltParticles.enableEmission = false;     // try to stop it from emitting by turning the emission off.
         trailRender.enabled = false;
         transform.position = hand.position;     // move into position everything is off by this point. yet it still emits.
         transform.rotation = hand.rotation;
         boltParticles.Clear();                    // i even clear the particles, and they still show up.
         rigidbody.velocity=Vector3.zero;
     }
     
     function fire()
     {
         targetVec = pointer.position;
         fired=true;
         trailRender.enabled = true;
         renderer.enabled = true;
         boltLight.enabled = true;
         collider.enabled = true;
         boltParticles.emissionRate = BPEMRate;     // set the emission rate back to normal
         boltParticles.enableEmission = true;     // turn it back on
     }
 
     function explode()
     {
         fired=false;
         renderer.enabled = false;
         collider.enabled = false;
         rigidbody.velocity=Vector3.zero;
         explodeParticles.Emit(20);
         explodeLight.range=10;
     }

code is ran in this order:

load >> fire >> explode

then it repeats if u click again.

i have come across this before, but i was always able to solve it by turning it back on after a yield waitForEndOfFrame();. but in this case i'm getting a bunch of coroutine errors, and that's over my head right now.

my question is this: is there any way to stop it from emitting during the re-position, without using coroutines?

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

Answer by hardmode2236 · Dec 11, 2014 at 07:03 PM

Oh man i cant belive i didnt try this before i posted...

i put the particle system into its own separate child GameObject and disable / enable that object instead of trying to change the particle system.

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

25 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

Related Questions

How do I make instantiated particles inherit Transform movement from their parent object? 1 Answer

How to stop particles from spawning too high 0 Answers

Particles wont rotate with system or parent 1 Answer

Particle System wont play? 1 Answer

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


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