// Use this for initialization void Start() { cam = Camera.main; rb = GetComponent <Rigidbody2D>(); if (energyBar == null) { energyBar = GameObject.Find("energyBar").GetComponent <bar>(); } if (attractorMassBar == null) { attractorMassBar = GameObject.Find("energyUsageBar").GetComponent <bar>(); } if (healthBar == null) { healthBar = GameObject.Find("healthBar").GetComponent <bar>(); } energyBar.changeValue(energy, MaxEnergy); attractorMassBar.changeValue(attractorMass, MaxAttractorMass); healthBar.changeValue(health, MaxHealth); numberText = GameObject.Find("attractorMass").GetComponent <TextMeshProUGUI>(); }