Quantcast
Channel: Answers for "all objects sharing script get destroyed?"
Viewing all articles
Browse latest Browse all 9

Answer by robhuhn

$
0
0
I guess because all of them have the tag "resource". You should check if *this* is the clicked object or destroy the object which was hit. (code not tested) if (hit.gameObject.Equals(gameObject)) { Destroy(gameObject); } or if (hit.transform.tag == "resource") { Destroy ( hit.gameObject ); }

Viewing all articles
Browse latest Browse all 9

Trending Articles



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