Quantcast
Channel: Questions in topic: "enemy"
Viewing all articles
Browse latest Browse all 1488

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

$
0
0
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 }

Viewing all articles
Browse latest Browse all 1488

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>