O'Reilly logo

Learning Unity iOS Game Development by Kyle Langley

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 the obstacle

The obstacle will consist of two parts. There will be an image of an axe that we will rotate around and a base image that the axe will rotate around. The reason we will be controlling the rotation of the axe instead of using another animation is that it would be more complicated to scale Box Collider 2D on the object to always fit the rotating bounds of the axe. Perform the following steps:

  1. To begin with, navigate to the Assets folder, right-click on it, select Create and then Folder.
  2. Name the folder Obstacle and open this folder.
  3. Now, right-click on the Obstacle folder and click on Import New Asset….
  4. Navigate to the Art files for the book and open the ChapterThree_Obstacle folder.
  5. Then, select Obstacle_Axe.png and click on

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