How to add blood splatter effects to enemies in Unity

Let’s go over how to add a blood splatter effect to enemies when they are shot.

I have previously shown how to set up the shooting in this article.

First, create or download the effect from the asset store:

Open up the PlayerShoot script. Add a serialized GameObject for the blood effect:

Update the Shoot function to check if you hit an enemy. If an enemy was hit instantiate the effect at point of impact. To prevent the effect from instantiating inside the enemy add the hit normal multiplied by 0.1 . The value of the hit normal is 1 so if did not multiply it by .1 the effect would show up one unit outside of the enemy. Use Quaternion.LookRotation to rotate the effect outwards:

Lastly, add the effect to the script on the inspector and ensure the tag is set on the enemy:

Good luck!

--

--

--

Unity / C# Game developer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Top 15 Software Vendor Interview Questions

IDAVOLL NETWORK Bi-Weekly Newsletter (June Edition (1))

How to Learn Drupal

People Who Are Serious About Programming Should Make Tools

Collections in java

Learning in Action!!!

Join Long Haul with 0xKongz

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Niklas Bergstrand

Niklas Bergstrand

Unity / C# Game developer

More from Medium

Arthur C. Clarke and wonders in Tech

Introducing a New Way to Take Control of Corporate Credit Card Spend

Introducing a New Way to Take Control of Corporate Credit Card Spend

Feeling Burned Out Already? Rediscover Your “Why” to Get Your Mojo Back