Hello! I need to find a way to reference an instatiated object, but I am having a hard time finding it out by myself. So, this is my current instantiation code:
GameObject player1Target; player1Target = (Instantiate(player1, new Vector3(spawnPointP1.transform.position.x, spawnPointP1.transform.position.y ,-0.9f), Quaternion.identity)) as GameObject;
As you can see, it’s being spawned as a “GameObject”. This is all fine and dandy, but I want to instantiate it and SetActive(false). This is because the first thing that happens after you start the game, you will be thrown into the world map, where you can pick a stage to start in. I want these characters to be SetActive(true) whenever they are thrown into a stage.
How do I reference these instantiated gameObjects intelligently?