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
2
Question by mbenn250 · Dec 11, 2015 at 03:08 PM · unity 5particle system2d-gameplaycollider 2d5.3

Changing the radius of Unity 5.3 Particle Systems

I have been hyped about the 5.3 release after hearing that 2D colliders would now be supported by Particle Systems, and that the Buoyancy Effector is now a reality. However, with the improvements to the particle system in effect, I am left with some difficult problems. Back in 5.2, I could change the width and size of a particle system by changing the scale of the game object that holds it. But now, I cannot change the x scale because it now scales the entire particle effect, meaning that the particles are now strangely elongated. I assumed that when the particle system changes went live, the particle system functions that were initially impossible to change via script would become changeable. However, while most of the other functions are changeable, the SHAPE of the particle system is get only, and I cannot change individual components of the shape by constructing a new ParticleSystems.Shape (just an example, different in reality) and setting it to the particle system shape. Does anyone have an idea for a workaround, or am I missing something?

Any help would be greatly appreciated.

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

5 Replies

· Add your reply
  • Sort: 
avatar image
4

Answer by mbenn250 · Dec 12, 2015 at 06:52 PM

Turns out that the problem has to be solved by using the following code (thanks to the forums for this answer).
ParticleSystem.ShapeModule shapeModule = GetComponent <ParticleSystem> ().shape;

You can then change the shapeModule's size, which in turn changes the particle effect's size. Not sure why Unity has you do this, but it works.

Comment
Add comment · Show 3 · 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 mbenn250 · Dec 14, 2015 at 07:25 PM 0
Share

$$anonymous$$eant to say GetComponent ();

avatar image Bocharick mbenn250 · Feb 08, 2016 at 10:11 AM 0
Share

ParticleSystem.Shape$$anonymous$$odule shape$$anonymous$$odule = GetComponent ().shape;

something wrong here, still can't acess to shape for changing particle system shape radius
avatar image Teravisor mbenn250 · Feb 08, 2016 at 10:13 AM 0
Share

Easiest solution is to make spaces between < and word to write it. Like .

avatar image
2

Answer by Bocharick · Feb 10, 2016 at 06:41 PM

I found solution of changing shape through script.

NOT working:

 public ParticleSystem psystem;
 void Start(){
 psystem.shape.box = new Vector3(2,2,2); // error, couldn't compile
 //psystem.shape.box.Set(2,2,2); // has no error, and compile, but has no results
 }

Working:

     public ParticleSystem psystem;
     void Start(){
     var x = psystem.shape;
     x.box = new Vector3(2,2,2); // solve my problem
     //x.box.Set(2,2,2); - still has no error, but still has no results
     // if you want change shape cone radius - x.radius = 34345;
     }

Hope it will helpfull. I broke my brain till found this solution.

Comment
Add comment · Show 1 · 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 Attrom · Apr 04, 2016 at 08:58 AM 0
Share

Same here, took me like 1 hour but here is the same chunk of code(just that is for radius):

     private ParticleSystem PS2;    
     var rad2 = PS2.shape;
     rad2.enabled = true;
     rad2.radius *= whatever_amount_you_want_to_multiply_the_radius_by;

avatar image
1

Answer by richardkettlewell · Jan 02, 2016 at 08:41 PM

Also, you can retain the pre 5.3 scaling behaviour by setting the scaling mode in the initial module to Shape only.

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 Mikozouzou · Jan 20, 2017 at 04:01 PM

I didn't really find a way to apply the precedent answers to my project, so here is another one that could also help. It works on Unity 5.5.

 public ParticleSystem explosionFX;
 public float explosionRadius = 1f;
 
 void Explode()
 {
             ParticleSystem.ShapeModule shapeModule = explosionFX.shape;
             shapeModule.radius = explosionRadius;
             explosionFX.Play();
 }

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 Geek314159 · Dec 12, 2015 at 06:47 PM

You could try checking "emission" and changing it from there.

Comment
Add comment · Show 1 · 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 mbenn250 · Dec 12, 2015 at 06:49 PM 0
Share

The problem is that it is read-only.

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

8 People are following this question.

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

Related Questions

ParticleSystem or play a video? 1 Answer

does Unity continue to render particle systems while they arn't emitting 0 Answers

Use standard shader on particles meshes 0 Answers

Customising Particle Effects for exploding rocks?? 1 Answer

[Newbie] Particle System does not work right. 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