Building the particles

To make everything ready foe the game logic, I prefer building a quick particle system sample that will be displayed whenever the player correctly touches a fruit object. Building a particle system involves different steps starting with building a material for the particles, building the particles themselves and finally, spawning the particles. Let's start with the two main steps first and leave the spawning step until we reach part in the gameplay logic.

Building the material

Add a new material to Content Browser and name it particlesMaterial, then double click to open the material editor. Select its base node and set Blend Mode to Translucent and Shading Model to Unlit. With these two options, you will find some of the inputs the material has disabled as we will not need them with a typical particle material.

Building the material

Now you can add the RadialGradientExponential node to your material grid, which will be responsible for showing a radial gradient shape (small particle shape) in the shaded surface.

Also, add a Particle Color node, which will hold the color of the particles (you will be able to change it later per instance). Now as you need to connect color to the material Emissive Color and alpha to the Opacity material input, you will need to add a Multiply node to multiply the RadialGradientExponential value to the Particle Color node values and display a correctly shaded particle at the end.

Building the material

Building the particle system

To add a new particle system in the editor, you can just right-click inside your Content Browser and press Particle System. And it will add one directly! Name it (in my case, it is called choppingParticles) and then double-click on it to open the particle system editor (Cascade).

The Cascade editor is divided into four parts:

  1. Emitters: This area holds your emitters. The powerful thing inside Unreal particles is that a particle system can have as many emitters as you want with different shapes and attributes.
  2. It starts with one emitter which will be enough to make a sample for this game.
  3. Viewport: This is a real-time view of your particle system, so you can check your progress as you go. You don't have to run in a game mode to check it!
  4. Details: This is a dynamic sensitive area, where its content will change according to your current selected node, emitter, or option.
  5. Curve Editor: Sometimes, entering the values will be better using curves rather than float numbers.

Emitter should be one entity, but in fact, each part of the emitter is a whole new world with its own list of options to be tweaked. You can also add many other unique options to control the particle behaviors.

Building the particle system

Keep in mind that working with particle systems requires an artist more than a programmer or coder. The only changes I made for the particle system was changing Material in the Required section to the one we made in the previous point. Set the Use Local Space to true in the Required section too, to force the particles emitter to update in the local space.

From the Initial Size section, I changed the Max and Min values to 20.0 rather than 25.0 as it fits more fruits.

Also, in the Initial Velocity section, I changed all of the Z values to negative rather than positive to force the particle to move down and not up.

Finally, I added a curve using the small curve button in the Color Over Life section. As the section name implies, that curve will be used to adjust the color over a lifetime. By changing the first and last points of each color curve, I was able to set its color to yellow with some sort of opacity.

Building the particle system

Feel free to keep changing the values as the entire value name implies what they are and what they are going to affect. Also, feel free to add more than one emitter to generate more complex particle systems, but be aware that you are building for mobile devices, and particles need to be optimized!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.128.204.5