i am on the game over tutorial for the beginner game tutorials and as soon as i collide or fall off the map my player loses material and is frozen in the air and the ground of my game goes shorter . its like it resets back to an early save or something! Here is my code : using UnityEngine;
using UnityEngine.SceneManagement;
public class gameManager : MonoBehaviour
{
public bool gameEnded = false;
public void EndGame()
{
if(gameEnded == false)
{
gameEnded = true;
Debug.Log("GAMEOVER");
Restart();
}
}
void Restart()
{
SceneManager.LoadScene(SceneManager.GetActiveScene().name);
}
}