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 user-9567 (google) · Feb 25, 2011 at 12:39 PM · particlesemitter

Particles stop emitting?!

The particle emitter stops emitting after i use the slider to change the direction of particles to the right?! It moves some of the particles but then stops emitting all together? Why is this happening? Im i missing something? Plz help!

var speed: int=5; var right : Vector3; static var Slide: float =0;

function Update (){ transform.Translate(Vector3.right * Time.deltaTime*Slide);

}

function OnGUI(){ GUI.Box (Rect(5,150,90,55), "Wind Direction"); Slide = GUI.HorizontalSlider (Rect(10,155,80,30), Slide, -200,200); }

Comment
Add comment · Show 2
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 DaveA · Feb 25, 2011 at 04:10 PM 0
Share

Not enough info here. What particles? Is this attached to an object with a particle emitter on it? What is Slide used for?

avatar image user-9567 (google) · Feb 25, 2011 at 04:18 PM 0
Share

I have just a simple particle emitter that this code is attached to with a slider called Slide. I just need the Slider to change the direction of the particles being emitted. It does this but only for a second and no more particles are emitted after the slider has been moved and your left with an empty scene?

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Alec-Slayden · Feb 25, 2011 at 07:32 PM

Your code will not change the particle direction, it will move your whole emitter.

Your particle emitter is on a game object, and it is the transform of that game object that you're translating to the right with

transform.Translate(Vector3.right * Time.deltaTime*Slide);

Since you're doing that every frame, it will quickly race out of camera view. It could seem as though the particles are moving to the right, but really the whole system is.

what you'll want to do is modify the localVelocity or worldVelocity of the particles being emitted to adjust their starting direction. if you want all of them to immediately change direction you'll also want to look into particle velocity, which is slightly trickier since you have to go through the particles.

if the script is on your emitter you can access the local or world velocity Vector3's like so:

transform.particleEmitter.localVelocity 
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

No one has followed this question yet.

Related Questions

Activating a particle emitter whith onTriggerEnter ? 5 Answers

Particle delay 1 Answer

Particle Emitter Breaks in emission. Help? 1 Answer

Particles do not appear on play but do on emit 0 Answers

Particle Sub Emitter Bug 5.5.3f1 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