public void CmdPlayerDropFlag() { Transform childTran = this.transform.GetChild(this.transform.childCount - 1); Flag flag = childTran.gameObject.GetComponent <Flag>(); if (flag) { flag.CmdDropFlag(); } }