I am trying to create a temp GameObject called tempMap.
I want to change to position and create the tempMap before creating the original GameObject Map.

	Map.transform.position = new Vector3 (0, 0, 0);
	GameObject tempMap = Map;
	tempMap.transform.position =  new Vector3 (0, 0, 20);

The question is… if I do this I have an understanding that tempMap will have position of 0,0,20 and the Map will have position of 0,0,0 but the position of Map is changed as well when the position of the tempMap is updated.
Please Help, Thank you

You never created a second GameObject you only assign the variable “tempMap” to reference the same object as referencing “Map”.

If you like to create a new GameObject you have to use the “new” keyword.

GameObject tempMap = new GameObject("tempMapName");

If you want to make a copy of a existing gameobject , you have to use the instantiate method.

GameObject tmpMap =  (GameObject)Instantiate(map, new Vector3(0f, 0f, 20f), Quaternion.identity);