Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 BankShotZombies · Feb 20, 2018 at 03:32 AM · unity 5scripting problemscript.particlesystem

Using a Burst in a script

I'm trying to use the burst from a particle system. If someone can help me access the burst on the particle system through a script and run it, that would be very helpful. I'm just trying to simply make it so when I press play, the effect will go off. I know you can do this on particle system itself, but I want to do it by accessing it in a script. I've been using https://docs.unity3d.com/ScriptReference/ParticleSystem.Burst.html as a reference. Sorry if this is a weird question, but I'm pretty new to Unity and I'm still just getting the hang of it.

Comment
Add comment · Show 1
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 Ginxx009 · Feb 20, 2018 at 03:55 AM 0
Share

Could you paste your code on how you are doing it???

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Positive7 · Feb 20, 2018 at 04:20 AM

It is under emmision

 GetComponent<ParticleSystem>()
            .emission.SetBursts(new[]
                                {
                                    new ParticleSystem.Burst(1f, 10), //float_time, short_count
                                });
 

But I guess you just want to use ParticleSystem.Emit

Comment
Add comment · Show 5 · 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 Harinezumi · Feb 20, 2018 at 08:37 AM 0
Share

I think this is the correct answer.

@BankShotZombies , if this solves your problem, please reply in a comment. Additionally, you can check this article to see how to access the moduels of a ParticleSystem.

avatar image BankShotZombies Harinezumi · Feb 21, 2018 at 12:16 AM 0
Share

Thank you very much for your help. Would you $$anonymous$$d translating that code into Javascript/Unityscript? That would be much appreciated. Thanks again.

avatar image Positive7 BankShotZombies · Feb 21, 2018 at 01:33 AM 0
Share

I've rarely used js but I guess it would be something like this :

 #pragma strict
 
 function Start() 
 {
     GetComponent.<ParticleSystem>().emission.SetBursts([new ParticleSystem.Burst(1.0f, 10)]);
 }


You might also neeed to enable the emmision :

 GetComponent.<ParticleSystem>().emission.enabled = true;


Show more comments
avatar image
-3

Answer by muhammadtahiriqbal · Feb 20, 2018 at 04:48 AM

public ParticleSystem.Burst(float _time, short _count); or public ParticleSystem.Burst particle;

Construct a new Burst with a time and count. https://docs.unity3d.com/ScriptReference/ParticleSystem.Burst-ctor.html

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 Lizardsking · Oct 06, 2020 at 10:13 AM

I think you just need to call ps.Play(); It will burst particles every time you call it.

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

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

Related Questions

Is their any way to save a particle system when it's not instantiated yet? 2 Answers

Clickable object not properly working 1 Answer

Playmaker: How to use and get variables from other visual scripting or C#? 1 Answer

The spaceship acceleration script is good ? And how to use it with engine ? 0 Answers

HELP! Scripts looks fine but doesn't respond? 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