O'Reilly logo

Unity 5.x Game Development Blueprints by John P. Doran

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

Creating our player behaviour

Now that we have the basic world created, let's add in the ability for our plane to actually move and interact with our world. To start off with, let's make it actually move:

  1. From the Hierarchy tab, select the Plane object. Then, add a Rigid Body 2D component to it by selecting Component | Physics 2D | Rigidbody 2D.
  2. We want the object to always check for collision, so from the Inspector tab, change the Collision Detection property to Continuous.

    Now the plane will fall but it falls directly off screen. We want it to react to being hit on the ground, so let's add collision data to it. Generally, we want to use whatever collider is simple enough to get the job done without adding complexity, but in this case, I really ...

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