Quantcast
Viewing all articles
Browse latest Browse all 1488

Clone Independient Enemies

Hi I am new in unity and I have problems making clones of my Enemy. The problem is I have a compounded Enemy with different health in each bodypart, every body part have its own script with its own health and events, for example, in one of my Leg Scripts I have `if (OtherLeg.GetComponent().LegHealth2 <= 0 && LegHealth <= 0) { Destroy(Enemy); }` I have seen other scripts and they have health in another script and when health is 0 and they only destroy the gameObject, but in my case I can't do that because if I reference the other Leg or my main enemy the script will destroy all enemies and body parts referenced. Is there a way to reference gameobjects inside the same hierarchy? Maybe are better solutions, anything helps.

Viewing all articles
Browse latest Browse all 1488

Trending Articles



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