O'Reilly logo

Learn ARCore - Fundamentals of Google ARCore by Micheal Lanham

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

Positioning the chair

The last step is to allow the user to move the chair after they select it. Fortunately, we can do all that in code. Open up your code editor to the SceneController.cs file and follow along:

  1. Add a new public variable to the top of the class after the line identified:
public GameObject m_andyAndroidPrefab; //after mepublic float MoveSpeed = .1f;
  1. This new float MoveSpeed sets the speed at which the user can move an object. You can also think of it as the move sensitivity. We set it to the default value of .1f here, but feel free to change it in the Inspector later when testing.
  2. Locate the following highlighted section of code and replace it with this:
if (Input.touchCount < 1 || (touch = Input.GetTouch(0)).phase != ...

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