It looks like you're new here. If you want to get involved, click one of these buttons!
Does anyone know how to change background color in game, like for example in an endless runner if you pass 100 meters the background turns blue or something like that?
public class MyScript : MonoBehaviour
public float playerMeter;
public Image background;
public Camera cam;
public Color bgColor, camColor;
cam = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<Camera>();
cam.clearFlags = CameraClearFlags.SolidColor;
if (playerMeter >= 100)
background.color = bgColor;
cam.backgroundColor = camColor;
If you want to animate the color from white to something like blue use Dotween or Leantween.