public void BreakGame() { HealthBarControl hpControl = (HealthBarControl)GameObject.FindGameObjectWithTag("HPBar").GetComponent(typeof(HealthBarControl)); ManaBarControl coldControl = (ManaBarControl)GameObject.FindGameObjectWithTag("ManaBar").GetComponent(typeof(ManaBarControl)); instance.hp = hpControl.getValue(); instance.coldHp = coldControl.getValue(); Debug.Log("BreakGame(),hp: " + hp + ",coldHp: " + coldHp); //Debug.Log("check instance: " + hpControl.getValue()); PlayerController player = (PlayerController)GameObject.Find("Player").GetComponent(typeof(PlayerController)); instance.position = player.transform.position; instance.rotation = player.transform.rotation; Debug.Log("cur position: " + player.transform.position); recordBonfires(); Debug.Log("Number of triggered bonfires when break: " + numOfTriggeredBonfires()); }