Blueprint for gunshot VFX


#1

Hi everyone,

I’ve only recently started making the jump from animation to vfx, and was wondering if anyone would be able to suggest some tutorials/offer some advice for a problem I’m having…

I’m trying to set up a gunshot blueprint, where the muzzle flash particle emitter spawns a bullet mesh, which in turn spawns a bullet hole decal when it hits a surface. I’ve found a few tutotrials that show you how to set up a gun firing using a key press, but nothing that can cause an emitter to spawn another component.

Hope that makes sense :slight_smile:


#2

while i think what you’re suggesting is possible (using a particle mesh with collisions turned on to spawn a decal) i would strongly suggest doing it in a different way:

either, 1 - do a line trace when the gun is fired and spawn the decal at the impact location, then just play a muzzle flash effect at the gun muzzle.

or, 2 - spawn a projectile actor at the gun location and then spawn a decal at the impact point when the projectile hits a surface.

generally i’d use 1 for bullets from guns (ie things that move very fast) and 2 for missles etc. (ie things that move slowly enough to see.) There should be plenty of tutorials on youtube if you search for “line trace weapons” or “projectile weapons” in unreal 4.

Hope that helps!


#3

Second is how we do it for projectiles. Then you place your particle system in the BP as a component and make sure to kill it on deactivate.


#4

Thanks for the replies @tharlevfx and @Travis :slight_smile:

I think ‘line trace’ was the term I was missing. I did have a few tutorials stored up for the bullet collision/decal part - the bigger problem was working out how to make the effect ‘fire’ without a key input (eg. the bullet spawning when the particle emitter spawns a new particle). I’ll take a tour of Youtube tomorrow to see what I can find!


#5

A solution without any blueprinting will be hard. However, if you really wan’t to, you can do the following:

  • Create your 1st Emitter with the muzzleflash. Add an EventGenerator, e.g. with event type Spawn.
  • Create your 2nd Emitter, with EventReceiver and event type Spawn. Let the Emitter fire (Velocity in X or Y) a particle (e.g. Mesh Particle), your ‘bullet’. The Velocity defines the bullet speed. Add a Particle Collision Module to the Emitter and Kill the particle on Collision. Add a EventGenerator to your bullet emitter, with event type Death.
  • And here is where the Particle trickery reaches it’s limits. Spawning Decals on Particle Collision is not possible without extra coding or Blueprint events. You can implement Blueprint Particle OnCollision callback events to spawn decals, but you can’t spawn them with vanilla Unreal.
    What you could do, would be to spawn a Particle, which looks similar to a decal, but is actually still a billboard, rotated in the direction of the impactnormal/velocity (by adding an EventReceiver Module to a new ‘fake decal’ emitter).

The Blueprint linetrace is probably the cheapest and easiest solution though.


#6

Thanks @Priareos :slight_smile:

I’m pretty comfortable with using Cascade at this point and was hoping to pick up some Blueprint, seeing as a lot of folk here recommend having at least a basic knowledge of it.

Will hopefully post up some results this week when I’ve had a chance to play around a bit more with line tracing