O'Reilly logo

Learn Unity 4 for iOS Game Development by Philip Chu

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

Chapter     4

Making It Move: Scripting the Cube

Now that you know how to construct a static 3D scene by placing GameObjects, it’s time to make the scene dynamic, and more interesting, by adding movement to GameObjects while the game is played. After all, a 3D graphics scene is nice, but an animated 3D graphics scene is even better!

But applying animation data isn’t the only way to move a GameObject. Making a GameObject physical will cause it to move in response to collisions and forces, including gravity. And a script can also move a GameObject by changing the position and/or rotation values in its Transform Component. In fact, any method for moving a GameObject, whether it’s animation, physics, or a script, ultimately changes the Transform ...

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