Loading the level resets stuff so the code that you wrote may not be run. Unless you’re using DontDestroyOnLoad(); Your script is being reloaded along with everything else when you call a restart. This means that GetComponent<Animator>().SetBool("Slide", true); isn’t going to work in the same void as your restart. I strongly encourage you make a script that doesn’t get reloaded on restart with DontDestroyOnLoad(); and set the animator’s bool on that script instead after the level is finished loading.