I’m trying to set up a particle system for creating spent bullet shells when using a firearm in VR. The problem I am encountering is it seems to stop spawning new particles when the existing particles from the system hit their lifetime limit. Here’s a video illustrating the issue:
[video=“youtube;3_B7oNWaeJ0”]UE4 Particle shells don't reliably spawn/draw - YouTube
It’s hard to see in the video (sorry for the **** quality encoding, not sure what happened there), but it looks like it’s trying to move the existing particles on the ground once the first ones start going away. And I don’t really show this in the video either, but after all the existing particles have been killed, I can start spawning as many new ones as possible (spawning correctly) until they start disappearing again. It doesn’t appear to be a limit in the number of particles being spawned. I’ve tested with another firearm with a way higher rate of fire, and it will spawn as many shells as it should until, again, the old ones start going away. Turning the lifetime off in the particle kinda-sorta fixes the problem, until it hits (what I assume) is some upper limit of overall particles allowed and wont render any more, at all, ever, for that firearm. I definitely want them to disappear shortly after spawning for all sorts of reasons anyway, so that doesn’t seem like much of a solution.
As for my setup, in the blueprint for the firearm I have a particle system component. On Beginplay, I set the desired particle template (which is defined elsewhere depending on the type of ammo being used, so different ammo can have different ejected shells):
Also on Beginplay, I set the transform and which socket I want the particle to be attached to:
The particle system is set to only spawn one shell particle on activation, so the way I trigger the bullet shells to spawn is to activate the particle system in my firing loop:
As far as I can tell in the particle itself, there is no way to control particle spawning in the way I’m seeing it happen in game. Hopefully I’m just missing something obvious.
Also as a side note, I was previously spawning in the particle by using a “Spawn Emitter Attached” node in place of the activate node i’m now using.:
Visually, this seemed to work perfectly fine, and the particles behaved as I would expect them. The problem with this approach is I couldn’t figure out a way to receive any events generated by the particle system in my firearm blueprint (which I am using to play sounds when the bullet shells collide with the world). I suspect doing it the way I have it currently set up is probably performant as well since there is only ever one particle emitter per firearm. If that’s not the case I’d love to learn more.