Enemies drop blood on the closest object

When i shoot the enemy i want the enemy the drop blood on the nearest object(floor/wall),
and i have no idea where to start this code. Any help is appreciated

You could try and put a sphere collider on the projectile and then storing references to all objects that it hits on impact using OnTriggerEnter. Then write some logic that applies decals to the objects that was stored in some fashion say random or if you want in a cone in the direction the projectile was traveling.