private void Start() { am = GameObject.FindGameObjectWithTag("Audio Manager").GetComponent <AudioManager>(); gm = GameObject.FindGameObjectWithTag("Game Manager").GetComponent <GameManager>(); vd = GameObject.FindGameObjectWithTag("Victim").GetComponent <VictimDaddy>(); Delay = GameObject.FindGameObjectWithTag("Game Manager").GetComponent <GameManager>().Delay_Between_Spawns; }
private void Update() { if (this.gameObject.GetComponent <Mover>().Alive == false) { //detach the object and tell the mover script to stop moving detached = true; GameObjectChild.GetComponent <Rigidbody>().constraints = RigidbodyConstraints.None; //Spawn blood effects //GameObject fx = Instantiate(bloodFX, GameObjectChild.transform.position, Quaternion.identity); //Destroy(fx, 2f); GameObjectChild.parent = null; if (detached) { Destroy(this.gameObject, death_duration); } if (this.gameObject == GameObject.Find("Head") || this.gameObject == GameObject.Find("Torso")) { Destroy(GameObjectChild.parent, death_duration); } //If the GameObject has the same tag as specified, output this message in the console Debug.Log("Detach Object From parent and stop body part"); } vd = GameObject.FindGameObjectWithTag("Victim").GetComponent <VictimDaddy>(); print(vd); }
void Awake() { _instance = this; am = GameObject.FindGameObjectWithTag("Audio Manager").GetComponent <AudioManager>(); vd = GameObject.FindGameObjectWithTag("Victim").GetComponent <VictimDaddy>(); BC = GameObject.Find("BetterCubor"); }