This is the script that resets the level:
using UnityEngine;
using System.Collections;
public class KillScript : MonoBehaviour {
void OnTriggerEnter (Collider player) {
if (player.tag == "Player") {
Application.LoadLevel (0);
}
}
}
I don’t know why but everytime the level restarts the game objects in the game change color
Before restart:
After restart:
There is no script that has anything to do with changing the color, there is the script above, the script that moves the cube and a script that moves the camera along with the cube.