void Awake() { //get the gamestate instance gameState = GameObject.FindGameObjectWithTag("GameStateManager").GetComponent <GameStateManager>(); //calculate the start sqr magnitude of the object startSqrMag = transform.position.sqrMagnitude; //add the item to the gamestate gameState.AddSavedObject(startSqrMag); }