Unity 3D is a popular game engine that allows developers to create interactive 2D and 3D applications and games for various platforms, including mobile, desktop, consoles, and web. The engine offers a wide range of features, such as a powerful editor, a scripting language(C#, but blueprint-like programming is also possible), and a physics engine, making it a versatile tool for game development. In this article, we will provide a basic overview of Unity 3D, covering its key features and concepts, and how to use them to create a simple game.
Getting Started with Unity 3D
Before diving into game development, it’s important to have a basic understanding of Unity’s interface and how it works. Unity’s editor consists of various windows and panels, including the Scene View, Game View, Hierarchy and Inspector. The Scene View displays the game world and allows you to add and edit objects, while the Game View shows you what the game looks like in real-time. The Hierarchy displays a list of all the objects in the scene, and the Inspector allows you to modify an object’s properties.
Unity also has a scripting language called C#, which is used to create the logic and behavior of the game. You don’t need to be an expert in C# to start using Unity, but having a basic understanding of programming concepts such as variables, functions, and loops can be helpful.
To exemplify things, we will create a simple platformer. Follow these steps to get started:
Step 1: Create a New Project
To get started, open up Unity Hub(Unity’s software for managing projects). Click Projects on the left, then “New Project” on the right, like in the picture.

You’ll be given a list of templates, to speed up the initial part of developing if the game you’ve in mind fits a certain listed category(for example, making a first person game? You might want to select “FPS Microgame” and it’ll give you some basic assets and a small tutorial). In our case, select “2D”, give the project a name and then click “Create Project.

Step 2: Create a New Scene
In the editor, select File > New Scene to create a new scene. This will clear the current scene and create a new, empty one.
In Unity, a scene is a container that holds all of the objects, assets, and elements that make up a particular level or area of a game or application. A scene can include everything from 3D models, textures, and lighting to sounds, scripts, and UI elements.
Scenes are used to organize the different parts of a game or application and provide a way to switch between different areas or levels. For example, a game may have different scenes for the main menu, the game world, and the end credits. Each scene can be loaded and unloaded separately, allowing the game to run more efficiently and providing a way to manage the complexity of larger projects.
Scenes can also be exported and shared between different projects or developers, making them a powerful tool for collaboration and iteration.
Step 3: Create the Player Object
In the Hierarchy, right-click and select Create Empty. Rename the object to “Player” and drag a sprite onto it to add a visual representation. In the Inspector, add a Rigidbody2D component to the object, which will allow it to be affected by physics.
Step 4: Create the Platform Object
Create another empty object and rename it to “Platform.” Add a BoxCollider2D component to it, which will give it a physical shape. In the Inspector, set the Size property to (4, 1) to create a wide platform. Finally, add a Rigidbody2D component to the platform then move it to under the player object so that it can stand on it.
Step 5: Add Movement to the Player
To allow the player to move, we need to add some code to the Player object. Right-click on the Player object and select Create > C# Script. Name the script “PlayerController” and open it in your code editor of choice.
Inside the script, add the following code:
using UnityEngine;
public class PlayerController : MonoBehaviour
{
public float moveSpeed = 5f;
private Rigidbody2D rb;
void Start()
{
rb = GetComponent<Rigidbody2D>();
}
void Update()
{
float moveInput = Input.GetAxis("Horizontal");
rb.velocity = new Vector2(moveInput * moveSpeed, rb.velocity.y);
}
}
This code creates a PlayerController class that controls the player’s movement. We define a public moveSpeed variable that determines how fast the player moves, and a private Rigidbody2D variable to store a reference to the player’s Rigidbody2D component.
In the Start function, we use the GetComponent method to get a reference to the player’s Rigidbody2D component.
In the Update function, we use the Input.GetAxis method to get the horizontal input from the player(to go left and right)and rb.velocity sets the speed of the movement.
Step 6: Add Jumping to the Player
To add jumping to the player, we need to modify the PlayerController script. Add the following code to the PlayerController class:
public float jumpForce = 10f;
private bool isGrounded = false;
public Transform groundCheck;
public float checkRadius = 0.5f;
public LayerMask whatIsGround;
void Update()
{
// Move the player left or right
float moveInput = Input.GetAxis("Horizontal");
rb.velocity = new Vector2(moveInput * moveSpeed, rb.velocity.y);
// Check if the player is on the ground
isGrounded = Physics2D.OverlapCircle(groundCheck.position, checkRadius, whatIsGround);
// Jump if the player is on the ground and the jump button is pressed
if (isGrounded && Input.GetKeyDown(KeyCode.Space))
{
rb.velocity = Vector2.up * jumpForce;
}
}
This code adds a public jumpForce variable that determines how high the player jumps, and a groundCheck object that checks if the player is on the ground. We also define a checkRadius variable that determines the size of the ground check circle, and a whatIsGround variable that defines what objects count as “ground.”
In the Update function, we first move the player left or right as before. We then check if the player is on the ground using the Physics2D.OverlapCircle method, which checks if there are any objects within a certain radius of the groundCheck object. If the player is on the ground and the jump button is pressed, we set the player’s vertical velocity to jumpForce.
Step 7: Add Camera Follow
To make the camera follow the player, we need to create a new script. Right-click on the Assets folder and select Create > C# Script. Name the script “CameraFollow” and open it in your code editor.
Add the following code to the script:
using UnityEngine;
public class CameraFollow : MonoBehaviour
{
public Transform target;
public float smoothSpeed = 0.125f;
public Vector3 offset;
void LateUpdate()
{
Vector3 desiredPosition = target.position + offset;
Vector3 smoothedPosition = Vector3.Lerp(transform.position, desiredPosition, smoothSpeed);
transform.position = smoothedPosition;
}
}
This code creates a CameraFollow class that moves the camera to follow the player. We define a public target variable that stores a reference to the player object, a smoothSpeed variable that determines how smoothly the camera follows the player, and an offset variable that determines the distance between the camera and the player.
In the LateUpdate function, we calculate the desired position of the camera by adding the player’s position and the offset. We then use the Vector3.Lerp method to smoothly interpolate between the current camera position and the desired position, and set the camera’s position to the smoothed position.
Step 8: Test and Play
That’s it! You can now test and play your game by pressing the Play button in the Unity editor. You should be able to move the player left and right, jump, and have the camera follow the player as they move. Your very first working game!