I’m super new to this and doing the Tower defense course. I just got to the game over video where we change our endgame variable from a private bool to a public static bool. Then He has to create a new start method because static variables don’t reset with resetting the scene.
SooooI thought, well why make it static at all then? So I decided to experiment by just making it a public bool. I mean after all what is Crtl-Z for if not to hit it as fast as you can because you messed up your entire game and hard work by experimenting with variable attributes you barely understand right?
So after hitting Ctrl-Z a bunch and getting my code back to where it worked, I looked up static vs not. I now understand what screwed up was how the variable can be used by other scripts, and by removing the static I took away some needed functionality.
But what I can’t get my head around is why I should use them, or I guess really the uses cases they are designed for. Can anyone in super basic terms clear up why I would want one over the other, possibly with a use case of each?