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 != ...

Get Learn ARCore - Fundamentals of Google ARCore now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.