Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Unity 2020 Mobile Game Development

You're reading from   Unity 2020 Mobile Game Development Discover practical techniques and examples to create and deliver engaging games for Android and iOS

Arrow left icon
Product type Paperback
Published in Aug 2020
Publisher Packt
ISBN-13 9781838987336
Length 464 pages
Edition 2nd Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
John P. Doran John P. Doran
Author Profile Icon John P. Doran
John P. Doran
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. Building Your Game 2. Project Setup for Android and iOS Development FREE CHAPTER 3. Mobile Input/Touch Controls 4. Resolution-Independent UI 5. Advertising Using Unity Ads 6. Implementing In-App Purchases 7. Getting Social 8. Keeping Players Involved with Notifications 9. Using Unity Analytics 10. Making Your Title Juicy 11. Game Build and Submission 12. Augmented Reality 13. Other Books You May Enjoy

Spawning objects in AR

The simplest way to spawn an object in AR would be to make it so when the player taps on the screen it will spawn an object where our Placement Indicator object is. But before we do that, we first need to make an object that we'd want to create within the scene.

Follow the steps given here:

  1. Create a sphere by going to GameObject | 3D Object | Sphere.
  2. From the Inspector window, set Position to (0,0,0) and set Scale to (0.2, 0.2, 0.2).
  3. Add a Rigidbody component to the sphere by going to Component | Physics | Rigidbody.

By adding the Rigidbody component, we are letting Unity know that we want this object to be affected by things such as gravity and react to collision events and forces being applied to it. At this point, you could customize the object as much as you'd like, change the mesh and collider, and so on.

  1. Go to the Project window, and open the Prefabs folder. Create a prefab of our sphere by dragging and dropping it from the Hierarchy window to...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image