How would one do directional blood splatter decal like in Halo Combat Evolved?

I gave a video that should show you what I’m on about, now the blood splatter from the actual model being hit should be easy enough because it’s just a matter of emitting the particles when it’s been collided I can work out that much. However the trick I’m thinking of is getting it so that a decal appears in the direction the raycast hit the model you’re looking to make bleed. Note the elite a minute or so in that get’s killed and his purple blood splatters onto the wall.

The halo example I gave works like that as you can see, now would I need to create some sort of second raycast behind the model when the first ray cast initially hits so I can instantiate a randomised blood decal on the wall or floor? Or am I overthinking this and can I just have one raycast going straight through the model and just have it do another bit of code after it’s done hitting the collider?

I think you would have to use another raycast using the same direction but that ignores all layers except those of objects that blood may splatter onto. If you’re using decals you might also consider adding some offset to the hit point in order to avoid texture flickering.

RaycastHit hit = new RaycastHit();

if( Physics.Raycast( input-stuff-i-cant-recall ){
Vector3 hitPoint = hit.point;
hitPoint += hit.normal * .05f;
}

Of course! Thanks, that makes perfect sense and then if I want to have blood splatter on the enemy model itself I just apply a third more simple raycast on whichever organic that happens to be in the way.

This weekend is going to be fun :smile: