0% found this document useful (0 votes)
4 views7 pages

Introduction to Unity

Uploaded by

Lucifer 02
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views7 pages

Introduction to Unity

Uploaded by

Lucifer 02
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Introduction to Unity

Unity is a powerful and widely used game engine that allows developers to create 2D, 3D,
augmented reality (AR), and virtual reality (VR) games as well as interactive applications. Since its
release in 2005, Unity has grown to become one of the most popular engines due to its flexibility,
ease of use, and ability to publish projects across multiple platforms such as PC, mobile, consoles,
and the web. It offers a free version, making it accessible for beginners, while still providing advanced
tools for professionals. Unity’s large Asset Store allows creators to use ready-made models, textures,
scripts, and tools, speeding up the development process. With built-in physics, real-time lighting,
animation tools, and scripting in C#, Unity provides everything needed to take an idea from concept
to a finished interactive product.

GameObject

The GameObject menu lets you create an empty GameObject. The GameObject is the base container
for objects, scripts, and other components in Unity. Like a group, it has its own transform and, so, is a
logical means of organizing similar objects or meshes. At its simplest, a GameObject contains its
transforms (location and orientation) and a few other properties. With the addition of various
components, it can become almost anything you need. GameObjects are invaluable when used as a
parent group or “folder” to keep multiple scene objects organized. You can create various objects,
such as lights, particle systems, GUI 2D objects, and Unity primitive objects from scratch with
Components or find them ready-made in the Create Other submenu. Unlike many modeling
programs, you cannot change the number of segments in Unity’s primitive objects.

Unity Interface

When you open Unity, you will see its main workspace, which is divided into different panels, each
serving a unique purpose in the development process. The Scene View is where you visually arrange
and position the objects in your game world. You can freely navigate in this view to design your
environment. The Game View shows what the player will see through the camera when the game
runs. On the left side, the Hierarchy Window lists every object in the current scene in a structured
format. Below, the Project Window contains all your assets such as models, textures, sounds, and
scripts. On the right, the Inspector Window displays the properties of the currently selected object,
allowing you to adjust its position, rotation, scale, materials, or any attached components. At the top
of the interface, the Toolbar contains tools for moving, rotating, scaling, and adjusting objects, as
well as buttons to play, pause, and step through your game during testing. Understanding how these
panels work together is essential for efficient development in Unity.

Unity Interface (Detailed)

The Unity interface is the main workspace where you create and manage your game. It is divided into
multiple panels, each located in a fixed area by default, though you can rearrange them to suit your
workflow.

• Hierarchy Window – Located on the left side of the interface. It lists all the game objects
present in the current scene in a tree structure. You can use it to organize game objects by
creating parent–child relationships, grouping items, and renaming them for better
management.

• Scene View – Found in the center of the interface. This is the main 3D or 2D workspace
where you arrange, position, and design objects. You can navigate using the right mouse
button and the WASD keys, and use tools like Move (W), Rotate (E), and Scale (R) directly
here.

• Game View – Located as a tab next to the Scene View in the center. It shows exactly how
the player will see the game through the active camera when you press the Play button.

• Inspector Window – Placed on the right side of the interface. It displays and allows editing
of all properties and components of the currently selected object. This is where you change
Transform values, assign materials, attach scripts, and adjust settings.

• Project Window – Found at the bottom of the interface. It stores all assets in your project,
including 3D models, textures, audio files, scripts, and prefabs. It works like a file explorer for
your game’s resources.

• Toolbar – Positioned at the top of the interface. It contains the selection tools (Move, Rotate,
Scale), as well as the Play, Pause, and Step buttons for testing your game. The Toolbar also
shows the account and layout settings

Transforming Objects

In 3D space, you use what is called the Cartesian coordinate system. If you come from Autodesk
products, you will be used to Z representing “up” in the world. This derived from traditional drafting,
where the paper coordinates on the drafting table were X and Y, so Z became up. In Unity, Y is up,
harking back to the early days of 2D monitor space, where X is horizontal and Y is vertical. With the
advent of 3D space on computers, Z was assigned as back or forward from the monitor. Z depth is an
important concept in real-time applications, as it is used to determine the order objects are drawn
into the scene. No matter which way is up, the directions are color-coded, with red, green, blue
(RGB) corresponding to X, Y, Z. Objects imported from applications using Z up will retain their original
orientation, regardless of coordinate system. Objects can be transformed (moved, rotated, scaled)
around the scene with the rest of the tools on the upper left toolbar (Figure 2-29). Figure 2-29.
Translate(Move), Rotate, and Scale Tool gizmos 1. Select the cube from the Hierarchy view or by
picking it in the Scene view. 2. Select the Move button. A Transform axis appears for the cube. 3. Click
and drag on any of the three axes.

Collision :

Another important concept in real time is that of collision. Once players are allowed to travel
wherever they wish in a 3D world, physical constraints must be set to prevent them from traveling
through walls, yet allowing them to move over uneven terrain, stairs, and other obstacles. In a 3D
engine, typically, the constraints will be invisible primitive objects, or they may be derived from the
mesh object’s geometry directly. The former are the most economical, as far as frame rate goes.
With complicated meshes, one often creates a lower poly standin for collision. Many game engines
will do this for you. Poly (short for polygon): This term is used in many different ways, depending on
the application. In real time, we are generally talking about a triangular face of a mesh object. Poly
count refers to the number of polygons or “tris” in a mesh object or in an entire scene. People new
to the game-development process almost always ask how many polys their characters should be. The
answer is always dependent on whatever else is happening in the scene. If you have a scene with a
lot of geometry that is drawn at the same time in every frame, the number would be a lot lower than
if the character was always alone in a desert with a couple of rock formations. Another important
concept is how important the object is, or how close it will be viewed. If the object is secondary to
the plot or game play, it probably doesn’t warrant a high poly count. If the player will never see the
object larger than 200×200 pixels worth of screen space, there’s a good chance that high poly detail
will be wasted resources, both in creation time and CPU usage.

Shaders : In 3D, after you create a mesh object, you assign a material to it that contains all the
properties required to visually describe its surface properties. These can be color, texture or pattern,
smoothness, reflectivity, emissive qualities, and many more. Traditionally, the render was handled
generically and limited to only a handful of properties. As graphics cards have improved, they have
taken over more of the tasks involved in describing the object’s surface, so now you have specific bits
of code called Shaders that tell the graphics card what to do for each material. Shaders, as with
lights, can be written for vertex rendering or pixel rendering. As before, vertex shaders are more
efficient than pixel shaders, while pixel shaders have much higher visual quality and are able to
portray many more effects.

Creating Terrain
To add a terrain, right-click in the Hierarchy and choose 3D Object → Terrain. This creates
a large flat surface you can sculpt and texture. In the Inspector, Unity provides Terrain Tools
for shaping the landscape. The Raise/Lower Terrain tool lets you create hills and valleys.
The Paint Texture tool applies textures such as grass, dirt, or sand. You can add textures by
clicking Edit Terrain Layers → Create Layer and selecting a texture from your assets. For
vegetation, the Paint Trees tool allows you to select tree prefabs and paint them directly onto
the terrain. Similarly, Paint Details can be used for grass or small plants. These tools help
create a realistic game environment quickly.

Adding a 3D Object

To add a 3D object, right-click in the Hierarchy, go to 3D Object, and choose a shape such as Cube,
Sphere, Cylinder, or Plane. The object appears in the Scene View at the origin (0,0,0) by default.
You can move it using the Move tool (W), rotate it with the Rotate tool (E), and change its size with
the Scale tool (R). To change its look, create a Material in the Project window, set its color or
texture, and drag it onto the object. This is the basic process for placing static or interactive
elements in your game.

Main Terrain Tools & Features

1. Neighbor Terrain

If your game world needs to be larger than a single terrain tile, you can connect multiple terrains
using the Set Neighbors option in the Terrain Inspector. This ensures smooth blending between
terrains without visible seams. Neighbor terrains are aligned so heightmaps and textures match
across edges.

2. Paint Details

This tool is used for adding small decorative elements such as grass, flowers, or small rocks.

• In the Terrain Inspector, select Paint Details.

• Click Edit Details → Add Grass Texture or Add Detail Mesh.


• Choose your texture or mesh from the Project Window and adjust parameters like density,
size, and color variation.

• Use the brush to paint details directly onto the terrain surface.

3. Paint Trees

This tool lets you add trees to the terrain efficiently.

• In the Terrain Inspector, choose Paint Trees.

• Click Edit Trees → Add Tree and select a tree prefab from your assets.

• Adjust tree height, width, and brush size.

• Paint over the terrain — Unity will place trees randomly within the brush area for a natural
look.

4. Terrain Settings

The Settings section in the Terrain Inspector controls global properties of the terrain, such as:

• Pixel Error – Affects rendering accuracy and performance.

• Base Map Distance – How far the detailed texture is visible before switching to a lower
resolution.

• Draw Instanced – Improves performance by batching similar objects.

• Lighting & Wind Settings – Affects how grass and trees react to lighting and wind.

• Material Settings – Choose how terrain materials are rendered (built-in or custom).

If you want, I can make a similar detailed step-by-step point format for Animation and Animator so
all your topics have the same style and your students get a full structured note set.
Do you want me to prepare that next?

Changing Terrain Size in Unity

1. Select the Terrain

o In the Hierarchy Window (left side), click on your Terrain object.

2. Open Terrain Settings

o In the Inspector Window (right side), scroll down to find the Settings tab (gear icon
in newer Unity versions).

3. Adjust Terrain Dimensions

o Look for the Mesh Resolution / Terrain Width, Length, and Height settings.

o Width – Controls the terrain’s size along the X-axis (left–right).

o Length – Controls the terrain’s size along the Z-axis (forward–backward).


o Height – Controls the maximum elevation along the Y-axis (up–down).

4. Apply the New Size

o Type in your desired values for width, length, and height.

o The terrain will resize instantly in the Scene View.

Terrain Tools – Detailed Explanation of Paint & Sculpt Options

Once you’ve installed Terrain Tools (via Window → Package Manager → Terrain Tools → Install),
selecting a Terrain in your Hierarchy and opening the Inspector will show a toolbar with multiple
terrain editing modes.
Here’s what each does:

1. Raise or Lower Terrain

• Function: Lets you sculpt the terrain up (raise) or down (lower) based on the brush stroke.

• How it works: Click and drag on the terrain to raise it; hold Shift and drag to lower it.

• Brush Size: Controls the area affected by your stroke.

• Opacity: Controls the speed/strength of raising or lowering.

• Falloff: Adjusts how smooth or sharp the edges of the brush are.

2. Set Height

• Function: Flattens or fills the terrain to a fixed height you choose.

• How it works: Set a target height in the settings, then click and drag to make terrain match
that height.

• Pick Height Tool: Lets you sample a height from the terrain to use as your target.

• Use case: Making flat platforms, paths, or building areas.

3. Smooth Height

• Function: Softens sharp edges and evens out rough terrain.

• How it works: Brush over jagged areas to blend height differences.

• Strength: Controls how much smoothing happens per stroke.

• Use case: Smoothing cliffs, hills, or paths for natural flow.

4. Paint Texture

• Function: Applies textures (e.g., grass, rock, sand) to the terrain surface.
• How it works:

1. Click Edit Terrain Layers → Create Layer.

2. Choose a texture from your assets.

3. Select the layer and paint over terrain with it.

• Opacity: Controls how strongly the texture is applied.

• Use case: Blending multiple textures for realism.

5. Paint Trees

• Function: Places trees randomly within your brush area.

• How it works:

1. Click Edit Trees → Add Tree.

2. Select a tree prefab.

3. Adjust tree density, height variation, and brush size.

4. Paint trees onto terrain.

• Randomize Height/Width: Makes forests look natural.

6. Paint Details

• Function: Adds small decorative elements like grass, flowers, or small rocks.

• How it works:

1. Click Edit Details → choose Add Grass Texture (2D) or Add Detail Mesh (3D).

2. Select your asset and set parameters like size and density.

3. Paint onto the terrain surface.

• Healthy/Dry Color: Controls grass color variation.

• Min/Max Width & Height: Adds random size variation for realism.

7. Stamp Terrain (Available with Terrain Tools)

• Function: Applies pre-made heightmap “stamps” to quickly form mountains, craters, etc.

• How it works: Select a stamp texture, adjust strength and size, then click to apply the shape.

8. Noise Tool (Available with Terrain Tools)

• Function: Generates procedural noise on the terrain for natural variation.


• How it works:

o Adjust Frequency to control how fine or large the noise patterns are.

o Adjust Seed for random variations.

o Strength controls the effect intensity.

9. Erosion Tools (Available with Terrain Tools)

• Function: Simulates natural erosion to make terrain more realistic.

• Types: Hydraulic (water), Thermal (temperature), Wind.

• How it works: Applies weathering patterns to slopes and valleys automatically.

10. Terrain Settings (Gear Icon)

• Pixel Error: Affects terrain LOD (level of detail) and performance.

• Base Map Distance: Distance before textures switch to a lower detail.

• Draw Instanced: Improves performance by batching similar objects.

• Material Settings: Choose built-in or custom shaders for the terrain.

You might also like