Ch.2 →“Getting Started with Unity: Navigating the Hub, Editor, and Physics Engine”

In Part 1, we explored the basics of Unity Hub and Unity Editor. Now, let’s dive deeper into the installation process, the concept of axes in Unity, and how to ensure multiple GameObjects align correctly in the same plane. Additionally, we’ll cover some essential shortcuts to enhance your workflow in Unity.

Installing Unity Hub and Unity Editor
Before you start creating games, you need to install Unity Hub and Unity Editor. Follow these steps:
- Download Unity Hub:
- Visit Unity’s official website.
- Navigate to the Downloads section and select Unity Hub.
- Download and install the application on your system.
2. Sign In or Create an Account:
Open Unity Hub and log in with your Unity account. If you don’t have one, create a free account.
3. Install Unity Editor:
- In Unity Hub, go to the “Installs” tab.
- Click “Add Editor” and select the version you want to install. For beginners, choose the latest stable release.
- Include additional modules like “Android Build Support” or “iOS Build Support” if you plan to target specific platforms.
4. Create Your First Project:
- Navigate to the “Projects” tab and click “New Project.”
- Select a template (e.g., 3D) and give your project a name.
- Click “Create,” and Unity Editor will launch.
Example: Ball Falling and Colliding with the Ground
To better understand the concepts of axes and alignment, let’s summarize the goal of a simple ball game. In this example, a ball should fall under the influence of gravity, collide with a block or ground, and behave as it would in the real world. This includes stopping on the ground or bouncing based on its physical properties.
We achieve this behavior by:
- Aligning the ball and ground in the same plane (e.g., Z-axis = 0).
- Adding a Rigidbody to the ball to enable physics.
- Ensuring both the ball and ground have appropriate colliders for realistic interactions.
Now, let’s delve into the axis concept and how to set up such a scene.
Understanding Axes and Aligning GameObjects
Unity operates in a 3D space, defined by three axes:
- X-axis: Horizontal direction (left and right).
- Y-axis: Vertical direction (up and down).
- Z-axis: Depth (forward and backward).
The Z-axis is crucial when positioning GameObjects in the same plane. By default, the Scene View might have objects scattered across different depths. To align them correctly:
Example: Creating a Ball that Falls on a Block
- Create a Block:
- Go to the Toolbar, select
GameObject > 3D Object > Cube
to create a block. - Position the block at the origin by setting its Position to
(0, 0, 0)
in the Inspector window. - Adjust its scale to create a platform by setting Scale to
(3, 0.5, 3)
.
2. Create a Ball:
- Add a sphere by selecting
GameObject > 3D Object > Sphere
. - Position the sphere above the block, e.g., Position
(0, 5, 0)
.
3. Align on the Same Plane:
- Ensure the Z-axis value for both the block and the ball is the same (e.g.,
Z = 0
). - This ensures they are aligned on the same plane, preventing the ball from missing the block when it falls.
4. Add Gravity to the Ball:
- Select the ball, click “Add Component” in the Inspector, and choose
Rigidbody
. - The Rigidbody component enables physics for the ball, causing it to fall under gravity.
5. Test the Setup:
- Press the Play button in the Toolbar. The ball should fall and land on the block.

Essential Shortcuts for Rotation and Manipulation
Working efficiently in Unity involves mastering shortcuts. Here are a few important ones:
- Rotate View:
Hold the Alt key (Windows) or Option key (Mac) and drag the mouse to rotate the Scene View.
- Focus on Object:
Select a GameObject and press F to zoom in and center it in the Scene View.
- Move Tool:
Press W to activate the Move tool and adjust the position of GameObjects.
- Rotate Tool:
Press E to activate the Rotate tool. Use the colored rings to rotate objects around specific axes.
- Scale Tool:
Press R to activate the Scale tool and resize objects.
- Switch Between Views:
Use Ctrl + Shift + F (Windows) or Cmd + Shift + F (Mac) to align the Scene View to the Main Camera.

Why Do We Need Physics in Games?
A game should feel as realistic as possible so that players can immerse themselves in the experience. Realistic physics allows objects to behave naturally, making the gameplay more engaging and relatable. This brings us to the next topic: physics in games.
Role of Physics in Games
Physics is a critical aspect of game development, making objects behave realistically within the game world. Unity’s physics engine allows you to simulate gravity, collisions, and other interactions between objects. Let’s explore how to apply physics to a GameObject with an example.
Example: Ball Falling and Colliding with the Ground
- Create the Ground:
- Add a Cube to act as the ground by selecting
GameObject > 3D Object > Cube
. - Position it at
(0, 0, 0)
and scale it to create a large surface, e.g.,(10, 1, 10)
.
2. Create the Ball:
- Add a Sphere by selecting
GameObject > 3D Object > Sphere
. - Position it above the ground, e.g.,
(0, 5, 0)
.
3. Add Rigidbody to the Ball:
- Select the Ball GameObject.
- Click “Add Component” in the Inspector and choose
Rigidbody
. - The Rigidbody component makes the ball subject to gravity and physics-based interactions.
4. Test Gravity:
- Press the Play button. The ball will fall and collide with the ground due to the Rigidbody component.
5. Enable Collisions:
- Ensure the ground and the ball both have colliders:
- The ground automatically has a Box Collider.
- The sphere automatically has a Sphere Collider.
- These colliders enable the physics engine to detect collisions and prevent objects from passing through each other.
6. Simulate Realistic Behavior:
- You can adjust the ball’s
Rigidbody
properties (e.g., mass, drag, and bounciness) to mimic real-life physics. For example: - Set the
Material
of the sphere’s collider to a Physic Material with high bounciness to make the ball bounce upon collision.
Steps to Apply Physics to Any GameObject
- Add a Rigidbody Component:
- Select the GameObject and click “Add Component” >
Rigidbody
. - This enables the object to interact with Unity’s physics system.
2. Add Colliders:
- Ensure the GameObject has an appropriate collider (e.g., Box Collider, Sphere Collider).
- Colliders define the physical shape of the object for collision detection.
3. Adjust Physics Properties:
- Modify Rigidbody properties like mass, drag, and angular drag for realistic motion.
4. Use Physics Materials:
- Apply Physic Materials to colliders to control surface interactions, such as friction and bounciness.
5. Test and Iterate:
- Use the Play mode to test interactions and fine-tune settings for desired behavior.
Conclusion
In this blog, we explored how to install Unity Hub and Editor, align objects in the same plane, and utilize essential shortcuts for smooth development. We also examined the role of physics in creating realistic interactions, with an example of a falling ball colliding with the ground. By mastering these concepts, you’re equipped to create dynamic and engaging game worlds. Stay tuned for more tips and tutorials in the next part!
Comments
Post a Comment