So, I am trying to make a blood particle system that is to be used in a hack and slash game type (think Bloodborne/Dark Souls/Etc) and I am running into a bit of an issue. Hopefully, this particle set will make its way onto the market place, but in order for that to happen, it has to be quite… adaptable for whatever way that people want to use it, which brings me to my problem. I am not certain how best to get the blood to spray in the direction and location of the melee weapon hit. I have already determined that my particles must be on mesh planes in order to avoid spinning with the camera (or looking otherwise odd), but transfering the direction/vector of the weapon’s swing as information into the particle system eludes me. If possible, I was planning on having a single blueprint that determined if the weapon’s swing vector was primarily horizontal or vertical, and then to choose an emitter to spawn from an array of either horizontal or vertical blood splashes. However, with the number of ways that I have read that people are trying to implement melee (line tracing along the weapon, weapon collision boxes, etc), I am not sure as to what the most robust interface for my system would be, which is another vexing issue. I would greatly value any insights the community might have in helping me on my way.
If you are doing any sort of built in trace, sweep, etc you can get return the hitresult and from that get the hit normal. Using the hit normal you can spawn an emitter at the impact location oriented to the hit normal. Its what I do for our impact hits.
I would actually store a vector value for each attack; tracing from a melee weapon returns frontal hits (assuming you trace from base-to-tip of the weapon every frame?). I assume you already have some sort of data table for your attacks that contains things like damage, knockback, reaction animation, etc…? Just add a Vector column that manually specifies the “angle of attack” and have a successful attack orient the blood spray particle emitter in that direction.