Military Weapons Silver asset package comes with almost all particles needed for weapons and ready to use: muzzle flashes, impact particles and trails. It have shell mesh as well, but it doesn’t have shell FX added. Before we move forward with next tutorial about weapons let’s create shell particle. It’s super easy!
<strong>This Tutorial has been created using Unreal Engine 4.8.2</strong>.
Make sure you are working on the same version of the engine.
Create new Particle System and name it FX_Shell_Pistol. To learn more about cascade (UE4 particle editor) you should watch: Introduction to Particles in UE4 and Materials and Particle Interactions. if you search for “cascade unreal engine tutorial” in google you will find a lot of tutorials because the same system was in UDK / UE3.
We need to change Type Data for emitter to New Mesh Data
For mesh select PistolA_Ammo static mesh. Now on Required Category:
- Kill on Deactivate should be set to true,
- Kill on Completed should be set to true,
- Emitter Loops should be 1,
In Spawn Category:
- Rate need to be 0,
- Burst Count should be 1. It means that 1 emitter will be spawned right after spawning Particle System,
In Lifetime Category change Distribution to Float Constant and set it to 1.5.
This is telling us how much time this emitter can live.
Now in Initial Size Category. Distribution need to be set to Float Constant and should be 1.
In Initial Velocity Category use Distribution Vector Uniform and set Max and Min like here:
Now add new category Acceleration -> Const Acceleration
This is adding constantly acceleration to emitter for given direction. It should be set like here :
Basically its simulating gravity.
Add another new category Rotation Rage -> Init Mesh Rotation Rate:
Thanks to Rotation Rate shell ammo will rotate randomly during life. That’s all in the cascade!
USEFUL TIP: Particle can be another bottleneck for GPU / CPU. You should always set Bounds Size for your particles because if it isn’t set it’s generating bounds in Tick! To do so left click on black space and find “use fixed bounds.”
Now go to BP_Weapon_Pistol blueprint and find Fire Event we had created in earlier post.
Let’s spawn particle:
That’s all – you should see shell meshes when firing pistol. If your meshes aren’t spawning in right place you can change AmmoEject socket location in Pistols_A skeletal mesh.
Implementing game is taking time but writing about this is taking much more effort!