O'Reilly logo

Unity 4.x Cookbook by Matt Smith, Chico Queiroz

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

Controlling cube movement through player controls

Many of the recipes in this chapter are built on this basic project, which constructs a scene with a textured terrain, a downward facing Main Camera, and a red cube (as shown in the following screenshot) that can be moved around by the user using the four directional arrow keys.

Controlling cube movement through player controls

How to do it...

To create a player-controlled cube, perform the following steps:

  1. Start a new project by navigating to Terrain Textures | GoodDirt.psd from the Terrain Assets Unity package (uncheck all of the other contents of this package as we don't need them and they'll just bloat the size of the project).
  2. Create a terrain, ...

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