RESULT
Name ; Adithya A
Project : Collect the Cubes
Introduction
I created a small Unity 3D game called Collect the Cubes. In this game, the player
controls a ball on a plane, collects cube objects, and wins once all the cubes are
picked up. This project helped me understand the basics of Unity game development
like movement, collisions, and updating the user interface.
Objectives
The main goals of the project were:
To make the player move with keyboard controls.
To collect cubes using collision detection.
To display the score on screen.
To show a win message after collecting all cubes.
Tools and Software
Unity 3D – for building the game.
C# – for writing the game script.
RESULT
Visual Studio/VS Code – as the code editor.
Code used ; using UnityEngine;
using [Link];
public class PlayerController : MonoBehaviour
public float speed = 10f;
public Text countText;
public Text winText;
private Rigidbody rb;
private int count;
void Start()
rb = GetComponent<Rigidbody>();
count = 0;
SetCountText();
[Link] = "";
void FixedUpdate()
{
float moveHorizontal = [Link]("Horizontal");
float moveVertical = [Link]("Vertical");
Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical);
[Link](movement * speed);
}
RESULT
void OnTriggerEnter(Collider other)
if ([Link]("Pickup"))
[Link](false);
count++;
SetCountText();
}
void SetCountText()
[Link] = "Count: " + [Link]();
if (count >= 5) // adjust depending on number of cubes
[Link] = "You Win!";
}
Hook It Up
1. Select Pickup → In Inspector, set Tag → Add Tag → "Pickup".
2. Drag your CountText and WinText from Hierarchy into the script slots on
Player.
3. Hit Play → Move with Arrow Keys/WASD → collect all cubes →
The ball moves smoothly with the keyboard.
Cubes disappear when collected.
The score increases as the player picks up cubes.
A “You Win!” message appears once all cubes are collected.
RESULT
Conclusion
This project taught me the basics of Unity in a very simple way. I learned how to
create objects, add physics, use colliders, write scripts, and connect UI to gameplay.
This project can be improved in the future by adding sounds, a timer, or more levels