O'Reilly logo

Unity Android Game Development by Example Beginner's Guide by Thomas Finnegan

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

Time for action – controlling the camera

We will only need one, fairly short script to control and manage our camera:

  1. To start and to keep everything organized, create a new empty GameObject and name it CameraRig. Also, to keep it simple, set its position to zero on each axis.
  2. Next, create three more empty GameObject and name them LeftPoint, RightPoint, and TopPoint. Set their X axis positions to 5. Position the LeftPoint to be in front of the slingshot and at 3 on the Y axis. The RightPoint needs to be positioned in front of the pig structure you created. The TopPoint can be over the slingshot, but needs to set to 8 on the Y axis. These three points will define the limits of where our camera can move when being dragged and following birds.
  3. Make ...

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