From the course: Unity: AR Visualization 02 Basic Interactivity

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Adding the axis to the part

Adding the axis to the part - Unity Tutorial

From the course: Unity: AR Visualization 02 Basic Interactivity

Start my 1-month free trial

Adding the axis to the part

- [Instructor] Our states look good to go. Now we're going to do some work. On the AR_Part to get us ready for moving. Let's go and select the AR_Part script. Double click to open in your code editor. All right, so, we have a couple of things here Not much. So, the first thing we're going to do is expose a variable, to allow us to set the axis. We're going to use a Transform Object. Transform Object, is that base transform that you see in the game object, when you create it. It contains both rotation, and scale, and position. So, it's perfect for us to set an axis. So, under our part definition, we're going to go public, transform, axis. All right, as we have our axis set up, it's pretty straight forward. Now we're going to set some flags, to help us process the move, better. But first, is a isMovable flag. So, what we want to do, is when we touch on the object, we want to know that it isMoveable. So, let's go and set…

Contents