if (HP [0] < 0) {
bodypart.SendMessage (“Die”, (Mathf.Round (Mathf.Abs (HP [0]))));
parentgobj.SendMessage (“Die”, 1); // number: decapitation
Destroy (transform.GetChild (0).gameObject);
if (Weapon != null) {
Weapon.transform.GetChild (0).GetComponent ().isTrigger = false;
Weapon.AddComponent ();
*1 Weapon.transform.parent = null;
*2 Weapon.transform.GetChild (0).tag = “Untagged”;
}
so as far as up to [*1] everything works just as I would like, but when I then add the [*2] part: the code doesnt do any of the changes to (Weapon)!!!
the weird part is that the console doesnt log a single error or notification.
Is there another way to remove the tag of an object that I should use instead?