Chapter 3. Player Character, Obstacles, and Pickups

The player character is the visual representation of what the user will input to the device. In the game we're creating, it will be quite simple. Our character will be designed to perform only three things: change its direction based on the swipe input of the user, collide with pickups in the world, and collide with obstacles in the world.

The swipe direction will determine the direction the character will move and with how much force it will move. The collision with pickups will add to a collection of points for the user. Also, the collision with obstacles will "kill" the character and end the game.

What is a character?

A character is a GameObject that has Rigidbody attached to it. Rigidbody is a component in Unity that will give the character simple physics and things such as gravity and collision. This means that Rigidbody also allows the character to collide with the world and with other GameObjects collision "touch" boxes.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset