public void UpdateMesh() { //Get an integer value from the slider, then set the slider //to match that value (to make sure they're the same) int sliderVal = Mathf.FloorToInt(resolutionSlider.value); resolutionSlider.value = sliderVal; //Update the text to display the slider value sliderText.text = sliderVal.ToString(); //Update the mesh with the new slider value (i.e. the new mesh resolution) meshScript.UpdateMesh(sliderVal); }