Using all three dees

Now that we know how to track the mouse left and right with the paddle, it's not a huge leap of logic to make our paddle track the y position of the mouse, and translate it into z coordinates. Remember that we're working with two different planes here:

  • The flat, two-dimensional plane of the computer screen
    • Horizontal X-axis
    • Vertical Y-axis
    • Origin point (0, 0) at the bottom-left of the screen
  • The deep, three-dimensional intersecting planes of our game world
    • Horizontal X-axis
    • Vertical Y-axis
    • Deep Z-axis
    • Origin point (0, 0, 0) in the middle of the world where the three planes meet
    Using all three dees

We're going to track the y movement of the mouse, and map ...

Get Unity 4.x Game Development by Example Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.