Hi I want to freeze the game but to freeze it I need to click and click is my button to fire and so it summons a “bullet” and then after that freezes the game before the bullet instantiated and so i somehow I need to tell the script to wait a bit so that Unity has enough time to Instantiate the bullet and then after the wait time is over he can destroy the bullet but I don’t know how.
else {
GameObject.Find("Live1Icon").GetComponent<SpriteRenderer>().enabled = false;
GameObject.Find("Live2Icon").GetComponent<SpriteRenderer>().enabled = false;
GameObject.Find("Live3Icon").GetComponent<SpriteRenderer>().enabled = false;
GameObject.Find("Main_Player_LVL1").GetComponent<SpriteRenderer>().enabled = false;
//wait 1/4 second and do the following:
Destroy (GameObject.Find ("Player_Shot_LVL1"));
}
}
shouldnt the bullet be in charge of destroying its self, and to do so you could make a simpler timer into the bullets Update method, using Time.time and Time.deltaTime.
They bullet its self, should really be incharged if its own movmeant and be killing its self.