Somebody get me a bucket
A common programmer mantra is "duplication is evil". The idea is that any time you type the same thing twice, you could be wasting time and effort. Remember that the less typing we do, the less likely we are to drop dead from the programmer illness I totally fabricated. The less duplication we do, the less "maintenance" we have to do if something goes wrong later—correcting one chunk of code is easier than correcting multiple duplicated chunks. But the rule for beginners is this: make it work first—then make it elegant.
Notice that we have some duplication in this line:
transform.position.x = Input.mousePosition.x – Screen.width/2)/(Screen.width/2);
We've typed Screen.width/2
twice. That won't do! For starters, typing makes my hands tired. What's more, we're forcing the computer to do that complicated math calculation twice. Why not do the calculation once and ask the computer to remember the result? Then, any time we want to talk about the screen's midpoint, we can...