Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 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
0
Question by MrJames · Dec 01, 2009 at 11:54 AM · gameobjectgraphicsparticles

Why are these objects there from the beginning?

Hello,

i've created some ParticleSystems and want to initiate them with some keys. To destroy these objects works fine, but i can't create them, because they are always in my gmae from the beginning. But non of my scripts call them? Here's a picture of my hierarchie: the two particle systems are "Smoke" and "flame"

Picture

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 duck · Dec 01, 2009 at 12:02 PM

I don't entirely understand your question, but if your goal is just to trigger some Smoke or Flame at certain moments in your game, it would probably be a better approach to toggle the .emit flag to true and false at those times, rather than actually create and destroy your particle system GameObjects.

You can keep the Particle System GameObject present in your scene the whole time. Just un-check 'emit' in the editor, and when you need some smoke or flame in your game, use scripting to set the position of the particle system, and set the .emit value to = true. Then, a few seconds later, set it back to false to stop the emitter.

If you want to trigger these emitters when a key is pressed, you'll need to use either Input.GetKey or Input.GetKeyUp. Click those links for the documentation.

hope this helps!

Comment
Add comment · Show 2 · 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 MrJames · Dec 01, 2009 at 12:11 PM 0
Share

Thanks, this works fine: Smoke.particleEmitter.emit = true; But wouldn't this be bad for performance for bigger projects?

avatar image duck ♦♦ · Dec 01, 2009 at 12:46 PM 0
Share

No, particle emitters are very well optimized. All the particles for a given emitter are drawn as if they were a single mesh, which is great for keeping your draw calls down.

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

How would I create a particle field that moves and looks like Saturn's (planet) ring 1 Answer

SHADER: Get *object* position or distinct value per *object* 1 Answer

Switching GameObject between static and non-static 2 Answers

Manipilating particle size with respect to movement of my gameobject ? 0 Answers

Player Guide (particles) destroy collectable 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