Difference between revisions of "Create a Terrain in Unity"

From __space Wiki
Jump to: navigation, search
m
m
Line 1: Line 1:
If you're using one of the lab computers, you can start by opening Unity, go to Projects and choose EventProjectTemplate from the list.  In the Project tab right-click on Empty World, pick Show in Explorer, copy it, paste, and choose a name for your scene.  Go back to unity and you can open this newly duplicated scene by double-clicking on it, again in the Project tab, where it should've appeared as a new item in your Assets folder.
+
If you're using one of the lab computers, you can start by opening Unity, go to Projects and choose EventProjectTemplate from the list.  In the Project tab right-click on Empty World, pick Show in Explorer, copy it, paste, and make sure to '''rename''' your scene (otherwise you might get conflicts with other people's scenes and yours might get erased!).  Go back to unity and you can open this newly duplicated scene by double-clicking on it, again in the Project tab, where it should've appeared as a new item in your Assets folder.
  
 
To create your terrain, first right-click in the tab labeled Hierarchy, go down to 3D Object, and from the sub-menu that appears, choose Terrain. Once you pick terrain, you should see a large blank plane appear, but when you select it, there are a lot of interesting options in the Inspector. (If there is any confusion about where all these tabs are, refer to [http://space.apps.uri.edu/wiki/index.php?title=Getting_Started_-_No_Scripting#Overview_of_editor_and_various_tabs this guide].)
 
To create your terrain, first right-click in the tab labeled Hierarchy, go down to 3D Object, and from the sub-menu that appears, choose Terrain. Once you pick terrain, you should see a large blank plane appear, but when you select it, there are a lot of interesting options in the Inspector. (If there is any confusion about where all these tabs are, refer to [http://space.apps.uri.edu/wiki/index.php?title=Getting_Started_-_No_Scripting#Overview_of_editor_and_various_tabs this guide].)

Revision as of 13:05, 20 October 2017

If you're using one of the lab computers, you can start by opening Unity, go to Projects and choose EventProjectTemplate from the list. In the Project tab right-click on Empty World, pick Show in Explorer, copy it, paste, and make sure to rename your scene (otherwise you might get conflicts with other people's scenes and yours might get erased!). Go back to unity and you can open this newly duplicated scene by double-clicking on it, again in the Project tab, where it should've appeared as a new item in your Assets folder.

To create your terrain, first right-click in the tab labeled Hierarchy, go down to 3D Object, and from the sub-menu that appears, choose Terrain. Once you pick terrain, you should see a large blank plane appear, but when you select it, there are a lot of interesting options in the Inspector. (If there is any confusion about where all these tabs are, refer to this guide.)

NewTerrain.png

Editing Terrain

Hills and Valleys - Adjusting Terrain Height

RaiseTerrain.png TerrainHeight.gif

Select the terrain icon that has an up arrow, then click (or click and drag to make continuous formations) anywhere on the terrain plane to raise it at that point. pressing shift while clicking will lower that part of the terrain, though it won't go below the terrain's initial level, no matter what y coordinate that may be.

Adding Texture to the Terrain

Pick the paintbrush icon from the terrain toolbar. PaintTerrain.png

DefaultTerrain.gif

Add a texture to paint with by going to Edit Texture, then Add Texture, then Albedo (RGB) and Smoothness (A), Select, and choose a compatible image type for your terrain. Only textures that are in somewhere in your assets will show up, so import any images you'd like to use first. The first texture you add becomes the default for the entire terrain. If you add another texture aside from that first one, you can paint over the default with the newly added one.

PaintTerrain.gif

Trees and Plants

In your Standard Assets folder you should already have another folder labeled 'Environment', but if you don't, import it now.

Using the brush to place trees: Brush size is how large the area you would like to paint with for 1 click, and Tree Density is how many trees will get placed in the circle when you click or move the mouse when you click and drag. Shift click to remove trees in the area you click with a radius of the chosen brush size.

Trees2.gif


Test it out!

Normally

You can view your new terrain by pressing the play button at the top middle of the editor. PlayButton.png


On the Vive

You can also try this out on the HTC Vive by first clicking on the collab button.

CollabButton.png

Then press publish.

Next, go over to the computer the Vive is hooked up to, and open Unity, and load up EventProjectTemplate. If the Collab button has an orange arrow next to it, click on it and update the project (this will make sure your new scene shows up in the Assets folder). Open your scene, press play, and put on the headset to try it out!


If you'd like to learn more about Unity, please refer to our more detailed tutorial!