Assembling the Angel

First, we need to create a new Sprite, and assign as Graphics "ACSpriteEvo1." We can rename the new Game Object as Player.

Then, we need to attach a collider to our Player character. This is a component, which allows the character to have a physical shape. Since we want our character to have a circular shape, we need to attach a CircleCollider2D. In the scene view, you should see a green circle around our character, and the default one should be good to go. In case you would like to tweak the dimensions of the green circle to encapsulate your character in a different way, you are free to change the Radius setting, along with the Offset one, if you need to translate the circle from the pivot point.

Another component we need is Rigidbody, which is a component that tells Unity that this object is subject to the Physics engine. Since we are building a 2D game, we need to use RigidBody2D. Once placed on the character, we need to make two important changes, which are as follows:

  1. We need to disable gravity, since our game is top-down, and therefore there is no gravity. To do so, you need to set the Gravity Scale to zero.
  2. We don't want our character to rotate due to collisions, so we need to freeze rotation in the z-axis. There is a checkbox under the constraints drop-down. Here is a screenshot of how the component should look in the end:
..................Content has been hidden....................

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