September 2010
Beginner
384 pages
8h 49m
English
Debug.Log() call so that it looks like this:Debug.Log( (Input.mousePosition.x -Screen.width/2) / (Screen.width/2) );
Ack! So many brackets! We use those brackets because we want the division and subtraction stuff to happen in the right sequence. You may remember order of operations rules from algebra class. BEDMAS: evaluate the Brackets first, then the Exponents, then Division and Multiplication, and finally, Addition and Subtraction.
To wrap your brain around it, here's what we're doing, in pseudocode:
(first thing)/(second thing)
We're dividing something by something else. The first thing is the -640 to 640 number range that we cooked up. The second thing is Screen.width/2 (the screen's midpoint). ...
Read now
Unlock full access