O'Reilly logo

Unity 3D Game Development by Example by Ryan Henson Creighton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required