O'Reilly logo

Developing AR Games for iOS and Android by Dominic Cushnan, Hassan EL Habbak

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 ball for the ball gun

Now that we have the general feeling of the game being set, we need to create the gun's projectile. It is understandable that because it's a ball gun, it will just shoot spheres, which we can create through a script. But before we can do that, we need a role model for the script to clone and create in the scene. So, the next thing we will work on is creating the basis for the gun's projectile prefab.

  1. Select ARCamera from the Hierarchy panel, and then from the GameObject menu navigate to Create | Other | Sphere. This will create a sphere where ARCamera is; however, it will not parent it to the camera. It is particularly useful when creating objects at the position of other objects. Change the name of the sphere ...

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