Quantcast
Channel: Questions in topic: "gun"
Viewing all articles
Browse latest Browse all 592

How to destroy objects only when they collide with other objects?

$
0
0
I have done a gun that automatically fires bullets every "update". The problem I'm having is when I added the script: void OnCollisionEnter() { Destroy (gameObject); } the bullets collide with each other and disappear. Is their a way to make it disappear only when it collides with objects other than the bullet? Any help is very much appreciated.

Viewing all articles
Browse latest Browse all 592

Trending Articles



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