Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 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 Xanthum · May 30, 2017 at 06:22 AM · prefabparticlesparticle systemunexpectedemit

Shooting Projectiles Script supposed to delete Projectile, not the parented Particle System

I have a Projectile Script which spawns a sphere in the player camera (with Rigidbody) I made a Prefab and this Prefab is instantiated inside the player cam every time I press LeftMouseButton And this Prefab has 2 components: The sphere and the particle system. The script is supposed to delete only the sphere, not the Particle System. I wanted to stop emitting particles after the sphere is gone (so that it looks better like now), but every time the particles just disappear right when the sphere is deleted and this looks a bit weird If you can help me solve this problem, I would be very thankful, but please keep in mind that I'm new to programming, so could you please explain it to me as newbie-style as you could (If that word even exists, but you get my point)alt text

script.png (24.1 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
1

Answer by lefinno · Jun 01, 2017 at 01:46 PM

you can first stop the particle emitting first (ParticleSystem.Stop) first and delay for a while and delete the whole thing.

cus once you deleted the parent, all of it's child will be deleted too.(sounds dark)

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
avatar image
1

Answer by centaurianmudpig · May 30, 2017 at 08:06 AM

I haven't used the ParticleSystem, so take this with a grain of salt; I presume you have attached your particle system directly to the Projectile as a prefab. When you destroy the projectile the particles are destroyed because they are attached to the destroyed object.

You want to either put the projectile in a limbo state, that the projectile is active in the scene but does not render the prefab, whilst it completes the animation. Or add the ParticleSystem as a child to the projectile and detach when the projectile is destroyed using Transform.SetParent().

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
avatar image
0

Answer by Tu-Le · May 30, 2017 at 06:54 AM

dont exactly know what you mean but remember getmousedown meaning you only run it once time when you hold down your mouse.

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

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Can a Particle System Use Custom Objects/Prefabs as Particles? 1 Answer

ParticleSystem is not emitting particles. 0 Answers

How to force a particle system emit from every vertex a mesh have? 3 Answers

Emit particles from image/sprite 1 Answer

Particle system won't restart emitting before last particle has died 3 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