# Unity Activity Notes

The activity we did was to get you practicing a little more with the **Translate**, **Rotate**, and **Scale** properties in Unity - all controlled by the **Transform** component (a built-in script) in the **Inspector** tab.

The Inspector tab gives you a visual representation of a text script. The three coordinates - X, Y, and Z are all **floating point** numbers (precision numbers that have a decimal point). Since it is a "float," as you move or click and drag over the letter to watch the numbers change, they change in a more precise range. On Friday, we will see the difference when we create integers (whole numbers) instead.

For a more in-depth look at using Translate, Rotate, and Scale, go here:

[https://hopemoore.gitbook.io/unity-basics/translate-rotate-and-scale/intro-to-transforms](https://hopemoore.gitbook.io/unity-basics/translate-rotate-and-scale/intro-to-transforms)

## Move / Translate&#x20;

**Unity Shortcut:** W key

**Move Button:**

![Located at the top left - Move button is selected here.](https://3674232557-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MR1EQixIaV64lGrdh2s%2F-MS9T0g4pGoiJO-K0A_a%2F-MS9XVxRLqKHJ11YYsYC%2Fimage.png?alt=media\&token=8c9c004e-19cf-47d3-b349-59d6f3d62fb1)

Your object will appear to have **arrows**:

![](https://lh4.googleusercontent.com/MYoRyu8PfHN1OJNePj8Tdmc3ldxgpCHQVXzY1HXqXPdQVgkp53Z61oAKCWI1D00bJuT5mCkBjcUjj35v7nESJifh7oP3qyVObv_Cjz9gQWhgsca10yKMFWJGaprdkKsB4JzX1ykiSEM)

## Rotate

**Unity Shortcut:** E key

**Rotate Button:**

![Located at the top left - Rotate button is selected here.](https://3674232557-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MR1EQixIaV64lGrdh2s%2F-MS9T0g4pGoiJO-K0A_a%2F-MS9YHTS99v1WBHXxNUc%2Fimage.png?alt=media\&token=fd5c2c2e-408f-4982-951e-db134e6b6b22)

Your object will appear to have **circles** or **curves**:

![](https://lh6.googleusercontent.com/sDADyYNrL60x9P31LCmTfpqh7MK1yDrujuSjGXXl01E6cG1bo6RdFoKAi8KR7Q528uA7v1pHHURwbQMKk4qBDdDnrT3LH0RhcdCXXaNJvZIdooZig8NkRsv27t1gq6dXUGfw5Wskc-U)

## Scale

**Unity Shortcut:** R key

**Scale Button:**

![Located at the top left - Scale button is selected here.](https://3674232557-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MR1EQixIaV64lGrdh2s%2F-MS9T0g4pGoiJO-K0A_a%2F-MS9Yp8LBNM7cYZb3XNT%2Fimage.png?alt=media\&token=cf75f1e3-bfe9-4e41-9250-9375847389d3)

&#x20;Your object will appear to have **blocks** at the end of lines:

![](https://lh4.googleusercontent.com/97hlsLObtgBi7Tmk3NERJFOhgtg4Nd0-RFOPfLlb_m8NEXN7W3Br-nOVEH6h_ufgEVBEbP_SVxc4Sv2uKMJfrVD7vbONdYyz9C_bWMWFP1ZCND7xmuqzU_D7W5ErdheEgo8W7gnmv0M)

## Rigidbody Component

By default, objects will not move when the game is played. The objects can also overlap.&#x20;

Adding a **Rigidbody** component will give the object simulated gravity and will use the object's **Collider** component to know where the edges of the objects are. This makes overlapping items with this component explode! It also allows objects to fall and affect those around them.

Add a built-in component through the **Inspector** window:

![Inspector window for an example cube.](https://3674232557-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MR1EQixIaV64lGrdh2s%2F-MS9T0g4pGoiJO-K0A_a%2F-MS9_cU75DKyuK55Ewc3%2Fimage.png?alt=media\&token=521db97a-5c7d-405a-9ec0-fa1ad64e231b)

Click the **Add Component** button.

![](https://3674232557-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MR1EQixIaV64lGrdh2s%2F-MS9_pdfaAoLz0H182mB%2F-MS9_qw-Vtsd28s0-dKJ%2Fimage.png?alt=media\&token=97a3645d-11fc-4bf9-9ce4-30c07c3afc0b)

Use the dropdown menu items to navigate to Physics > Rigidbody OR use the search and start typing the name of the component to find it:

![](https://3674232557-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MR1EQixIaV64lGrdh2s%2F-MS9_pdfaAoLz0H182mB%2F-MS9aQIq1G_SvTXIFWnJ%2Fimage.png?alt=media\&token=e077e712-1007-432a-8c73-b123d8e77427)

Click on the component to add it and it will appear in the Inspector window:

![The component appears at the bottom of the list of attached components.](https://3674232557-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MR1EQixIaV64lGrdh2s%2F-MS9_pdfaAoLz0H182mB%2F-MS9a__a68IwVXqX7c0d%2Fimage.png?alt=media\&token=3e0f68aa-dca4-476c-bcb3-024b6c73afe0)

## Creating a Material

Materials are separate, REUSABLE "objects" (called **Assets**) in Unity that you create and then add to other game objects in your scene.&#x20;

### **Step 1: Create a Material**

Your **Project** window is a visual representation of your project folder. It shows you your files in your **Assets** folder.

Right-click in your Project window and select Create > Material

![](https://3674232557-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MR1EQixIaV64lGrdh2s%2F-MS9ak_lJPW5pAGc979A%2F-MS9brrVHS1Ua7FSqyuM%2Fimage.png?alt=media\&token=9f4704a9-aa87-4a44-a5fa-9d2b93af4ba7)

This will create a new material, which you can name.

![](https://3674232557-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MR1EQixIaV64lGrdh2s%2F-MS9ak_lJPW5pAGc979A%2F-MS9c-NMvTWsGrBWhPGE%2Fimage.png?alt=media\&token=a5203f22-114d-49c8-9f1b-380a0d919cac)

This name can include spaces.

I named this "Blue Materia." (Yes, that was an accident and I didn't feel like changing it for this page.)

![](https://3674232557-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MR1EQixIaV64lGrdh2s%2F-MS9ak_lJPW5pAGc979A%2F-MS9cDemuy6aJt6iYCHG%2Fimage.png?alt=media\&token=fb983d72-f09c-45e2-aff9-10251d5570fa)

### **Step 2: Modify a Material**

Once selected, the properties of the material will appear in the **Inspector** window:

![](https://3674232557-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MR1EQixIaV64lGrdh2s%2F-MS9ak_lJPW5pAGc979A%2F-MS9cV8EdVxiwlscG-nh%2Fimage.png?alt=media\&token=38e8b1c8-f08d-49f8-baea-1d5023c8e38f)

Here, you can change different aspects of the material. We'll just change the color here by clicking on the white square next to "Albedo."

![](https://3674232557-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MR1EQixIaV64lGrdh2s%2F-MS9ak_lJPW5pAGc979A%2F-MS9ctI4LPu3IxN0YE_A%2Fimage.png?alt=media\&token=07b22ad4-33be-498b-bd9d-c11b44241a4a)

Click first on the **Hue** (color) in the circle, then on the square to choose your **Saturation** (intensity) and **Value** (brightness) of that color.

![Example of a type of blue.](https://3674232557-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MR1EQixIaV64lGrdh2s%2F-MS9ak_lJPW5pAGc979A%2F-MS9dIB2DrL5oVHAkDfu%2Fimage.png?alt=media\&token=0c6db66e-fbb1-4739-b683-bca55168f6d5)

Hit the ENTER key or close the color wheel popup. This will update the material.

![](https://3674232557-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MR1EQixIaV64lGrdh2s%2F-MS9ak_lJPW5pAGc979A%2F-MS9dVRHZUJ3UmrFDGw_%2Fimage.png?alt=media\&token=34cf9aca-4289-4d6e-a59a-d9904574f44e)

### Step 3: Adding a Material to an Object

Unity's best feature is its click-and-drag capability. To add your material to an object in your scene, click and drag your material from your **Project** window to the object in your **Scene** window OR **Hierarchy** window.

![](https://3674232557-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MR1EQixIaV64lGrdh2s%2F-MS9dzsFbd2nBdzYVNSB%2F-MS9eylzBd5_O5dkbzix%2FaddingMaterials.gif?alt=media\&token=ee5399da-fbf1-4570-b660-5bf65aedf903)

When it has been added, not only will you be able to see it update in the Scene window, but you can also see the Material component update at the bottom of the **Inspector** window.

![](https://3674232557-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MR1EQixIaV64lGrdh2s%2F-MS9dzsFbd2nBdzYVNSB%2F-MS9fMeGA2Ej8b_y5XPD%2Fimage.png?alt=media\&token=6841f858-69aa-4a89-aaf8-a59326b98d59)

{% hint style="danger" %}
Remember: When you update the properties of an asset in the **Project** window, it updates it for ALL objects the asset is added to.
{% endhint %}
