Unity VFX -- (2) play with the particle system

add spark

        Complex VFX is usually composed of multiple individual particle systems. When combined, these individual pieces can produce even more interesting effects. Next, let's add a spark effect to the flame.

        1. In the Hierarchy, expand the Fire_ParticleSystem_Prefab object and select the VFX_Sparks sub-object.

        2. Activate VFX_Sparks, in its Inspector panel, check the first check box, and then click Restart in the Particle Effect window. Now we can see sparks starting to appear in the center of the flame.

        The resulting spark effect looks like nothing more than white dots floating in the air. Let's make them look more realistic.

 Enable more modules for spark effects

        In order to change the appearance or behavior of a particle system, we need to enable and edit its modules. A particle system is composed of several different modules, each module controls the effect of different aspects of the particle system (such as color, size, speed, etc.).

        1. In the Hierarchy, select Fire_ParticleSystem_Prefab > VFX_Sparks. In its Inspector panel, we can observe that the currently enabled modules are Emiision, Shape and Renderer.

         The Emission, Shape and Renderer modules are enabled by default for all particle systems. They control how many particles are emitted, where they are emitted from, and how the particles look. We can expand each module by clicking on the corresponding name.

        2. To change the color of the sparkle over time, we need to enable and expand the Color over Lifetime module.

        3. To make the size of the spark change over time, we need to enable and expand the Size over Lifetime module.

        4. To make the sparks flicker randomly as they fly into the air, we enable and expand the Noise module.

        When these modules are enabled, we can immediately see the relevant changes in the scene view. With these additional modules, the sparks now look realistic, with slight variations in color, size and orientation. These modules in the example are already pre-configured. We will learn how to use these modules later.

 Exercise: modifying the flame

        Before practicing, select the Firepit game object in the Hierarchy, copy several identical game objects, and use these copied game objects to practice, such as Firepit_Blue and Firepit_Green in the picture below.

         Next, adjust the position of the copied game object, and then try to adjust the different modules. Don't worry about the specific meaning of each parameter of each module, just modify it at will to see the effect. For example, the effect of modifying the flame color to blue and green is as follows:

        Note that after making modifications, in some cases, you need to click the Restart button in the Particle Effect menu to see the changes.

Guess you like

Origin blog.csdn.net/vivo01/article/details/130161986