
Unity 4.x Game Development by Example: Beginner's Guide
By :

Add this line of code beneath the existing line of code:
Debug.Log(Input.mousePosition.x);
Your entire Script should look like this:
function Update () { transform.position.x = Input.mousePosition.x; Debug.Log(Input.mousePosition.x); }
Save and test your game.
Look at the very bottom of the screen for the results of your Debug.Log()
statement. If nothing shows up, follow these steps to enable
Console statements:
Navigate to Window | Console in the menu.
This is an important window! Dock it to your layout by clicking and dragging it beneath your Game view.
Ensure that Console messages are enabled by clicking on the little button with the comic book speech bubble.
As you move the mouse cursor left and right, you'll see this number changing. It goes from 0 when your mouse is at the left edge, and rapidly increases. The upper limit depends on your monitor resolution; on my screen, Input.mousePosition.x
maxes out at 1279! Earlier...
Change the font size
Change margin width
Change background colour