How to scale particle system in Unity?

How to scale particle system in unity?


 How to do:

In Unity, you can scale a particle system by modifying the "Scale" property in the "Particle System" component. Here is an example of how you could do this:

// Get a reference to the particle system
ParticleSystem particleSystem = GetComponent<ParticleSystem>();

// Set the scale of the particle system to 2
particleSystem.transform.localScale = new Vector3(2, 2, 2);

In the code above, we first get a reference to the ParticleSystem component on the object that the script is attached to. Then, we set the localScale property of the particle system's transform to a new Vector3 with x, y, and z values of 2. This will scale the particle system by a factor of 2 in all three dimensions.


Note that you can also scale the particle system in only one dimension by setting the x, y, or z component of the Vector3 value to the desired scale factor. For example, to scale the particle system by a factor of 3 in the x-direction only, you could use the following code:

particleSystem.transform.localScale = new Vector3(3, 1, 1);