// Start is called before the first frame update void Start() { mainObject = GameObject.Find("GameObject").GetComponent <forces>(); temperatureSlider = GameObject.Find("temperatureSlider").GetComponent <Slider>(); Soundsource = GameObject.Find("Sounds").GetComponent <AudioSource>(); //Playthis = GameObject.Find("Sounds").GetComponent<AudioClip>(); }
// Start is called before the first frame update void Start() { mainObject = GameObject.Find("GameObject").GetComponent <forces>(); if (GameObject.Find("temperatureSlider") != null) { temperatureSlider = GameObject.Find("temperatureSlider").GetComponent <Slider>(); } Soundsource = GameObject.Find("Sounds").GetComponent <AudioSource>(); }