How do code the clone I have made from instantiate?

Hi,
So in the project I am working on there is a player who can multiply and the person playing the game is able to modify the game. I am using instantiate to make him “multiply”:

public GameObject prefab;

// Update is called once per frame
void Update () {

	if (Input.GetKeyDown(KeyCode.G)) 
	{
		Instantiate(prefab, new Vector3(transform.position.x, transform.position.y, transform.position.z), Quaternion.identity);

	}

}

}

The problem is that I don’t know how to gain control of the future clones that emerge. They usually just drop and do nothing. How am I able to code for the future clones. I can’t just make copies of the player that are coded because there are multiple combinations you can make with the player so coding all the players combinations is tedious. I would think I would need to somehow make the future clones a variable to modify. Any suggestions. Thank you advance.

If you’re trying to reference the instantiated object, you can give it a type when you create it:

Instantiate(prefab, new Vector3(transform.position.x, transform.position.y, transform.position.z), Quaternion.identity);

becomes

GameObject _obj = (GameObject)Instantiate(prefab, new Vector3(transform.position.x, transform.position.y, transform.position.z), Quaternion.identity);

From there you can reference the gameObject as you would any other. For instance:

GameObject _obj = (GameObject)Instantiate(prefab, new Vector3(transform.position.x, transform.position.y, transform.position.z), Quaternion.identity);
_obj.transform.position = Vector3.zero;