Making our scripts interactive
In order for a script to behave based on user input, it needs to be constantly checking for changes in the keyboard state. As this can be considered a perpetual system, we'll use the Update
function, which, as you may recall, is called with every frame automatically.