When you transition scenes, all variables and scripts get reset. There are a couple of ways to get around this though, for example dont destroy on load but the top answer in this forum is a good explanation : https://stackoverflow.com/questions/32306704/how-to-pass-data-and-references-between-scenes-in-unity