// idk about u, but by making my variables static, it worked for me // example: // do this private static GameObject player; // and not this private GameObject player;