• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
Question by rct3fan24 · Jan 05, 2014 at 08:28 AM · particlesenemyblood

How do I use particles to make blood spurt from an enemy when you shoot it?

Hi fellow game developers... I've been trying to figure this out for a while now. How do I make blood spurt from an enemy using particles when it collides with your bullet?

Here's the script I have, for reference. (Yes, the enemy is a spider.)

 var health:int = 2;
 var bullet:GameObject;
 var deadSpider:GameObject;
 
 function OnCollisionEnter(bulletHit:Collision)
 {
     if(bulletHit.gameObject.tag == "bullet")
     {
         health = health - Fire.damage;
         Destroy(bulletHit.gameObject);
             
         Blood();
     }
 
     if(health <= 0)
     {
         Win.score = Win.score + 1;
         
         var spiderPos = this.gameObject.transform;
         Instantiate(deadSpider,spiderPos.position,spiderPos.rotation);
         
         Destroy(gameObject);
     }
 }
 
 function Blood()
 {
     //Make some particles emit from the object
 }
Comment
Benproductions1
Bleakmountain50

People who like this

0 Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Benproductions1 · Jan 05, 2014 at 09:06 AM 0
Share

This community is not for step by step tutorials. If you want that, you're in the wrong place. This website is for specific technical questions, NOT for tutorial requests!

avatar image rct3fan24 · Jan 05, 2014 at 09:30 AM 0
Share

@Benproductions1 I'm sorry, but I thought this was a place for asking questions about Unity, and I thought a step by step tutorial would be a good way to answer my question. It was just a suggestion, your answer doesn't need to be step by step. I honestly don't think it would make any difference if I hadn't suggested a step by step tutorial. I guess I'll just remove that part so people don't get mad at me. T_T

avatar image Benproductions1 · Jan 05, 2014 at 09:49 AM 1
Share

To answer your question: You could simply use another prefab for the particle effect and instantiate it. (like the deadSpider prefab)

People (inc. me) won't get mad at you, I was simply moderating the question, thank you for you honest response :)

1 Reply

· Add your reply
  • Sort: 
avatar image

Answer by superluigi · Jan 05, 2014 at 09:53 AM

I can't give you a step by step tutorial that's asking for a lot. Basically you have to create or buy the particle effect. You need to learn how to create paricle effects on your own. Then what you will do is instantiate the particle effect when your bullet and the spider collide. If u want the splatter to happen where the 2 objects collide you can have the particle effect appear in the bullets position but there are probably better ways to achieve a much better result.

Comment
Benproductions1
leonardon

People who like this

2 Show 0 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Update about the future of Unity Answers

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta later in June. Please note, we are aiming to set Unity Answers to read-only mode on the 31st of May in order to prepare for the final data migration.

For more information, please read our full announcement.

Follow this Question

Answers Answers and Comments

20 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to make blood splatter using projectors(or decals) 0 Answers

Recolor Grass 0 Answers

Bloodstream flow 0 Answers

Make blood on ground 0 Answers

Particle System - trailing blood 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges