Hi All,
Me and a friend was working on a script for my 2D platformer that has plenty of levels, i needed a checkpoint at level 25 so we got that working but im having problems adding another checkpoint for another level, please see script below, i was told to add the second if function inside the current, this is what i have but the second checkpoint is not working, any ideas peeps?
The second CP is level 26 for testing :).
**public class OnGUI2D : MonoBehaviour
{
public void ChangeScene(string sceneName)
{
if (PlayerPrefs.GetInt("Checkpoint", 0)==1)
{
LevelManager.instance.Score = 39560;
Application.LoadLevel(25);
}
else
if (PlayerPrefs.GetInt("Checkpoint", 0)==1)
{
LevelManager.instance.Score = 42440;
Application.LoadLevel(26);
}
else
{
Application.LoadLevel(sceneName);
}
}**