Challenge #3 - Player Setup

Tasks

  • Bring the idle player sprite in to the scene from the assets folder path shown in Fig 1 and name this object as “Standing Sprite”

  • Create an empty game object as a parent to the Standing Sprite object and name it as "Player"

  • Create a capsule collider around the Standing Sprite object and edit it to form a shape close to the standing sprite object

  • Add a RigidBody2D component to the Player game object

  • Freeze rotation along Z for the Player object to avoid the player fall over sideways when they jump from a higher floor edge in the game

  • Increase gravity scale to 5 so the player does not float when he jumps

Why did we use a capsule collider instead of a box collider. The base of a Box collider gets easily caught up on the edges of the floors creating a weird floating effect when the player steps to the edge of a sharp edge. The base of a capsule collider is curvy and gives a believable effect of player glide off edges corner

Fig 1

idle player.jpg