A Unity 3D top-down collection game where you roll a ball, collect pickups, and avoid an enemy — all before time runs out!
You control a cyan ball rolling around a walled arena. Your goal is to collect 12 yellow pickup cubes scattered across the map before the enemy catches you.
- Collect all 12 pickups → You Win!
- Enemy touches you → You Lose!
| Input | Action |
|---|---|
W / ↑ |
Move Forward |
S / ↓ |
Move Backward |
A / ← |
Move Left |
D / → |
Move Right |
Uses Unity's new Input System (
PlayerInputcomponent).
Assets/
├── Scripts/
│ ├── PlayerController.cs # Player movement, pickup collection, win/lose logic
│ ├── CameraController.cs # Smooth camera follow
│ ├── EnemyMovement.cs # NavMesh-based enemy AI
│ └── Rotator.cs # Pickup cube spin animation
Handles all core gameplay logic:
- Physics movement via
Rigidbody.AddForce()using the Input System - Pickup collection via trigger detection (Tag:
PickUp) - Win condition: Collect 12 pickups → shows "You Win!", destroys enemy
- Lose condition: Enemy collision → shows "You Lose!"
- Updates the count UI (TextMeshPro) on every pickup
- Follows the player with a fixed offset calculated at start
- Runs in
LateUpdate()to prevent camera jitter
- Uses Unity NavMesh to pathfind toward the player every frame
- Automatically navigates around obstacles in the arena
- Rotates pickup cubes continuously on all 3 axes for visual flair
(15, 30, 45) * Time.deltaTimefor smooth, frame-rate-independent spin
- Unity Version: Unity 6 (or 2022 LTS+)
- Packages Required:
com.unity.inputsystem— New Input Systemcom.unity.ai.navigation— NavMesh Componentscom.unity.textmeshpro— UI Text
- Player ball tagged as
Player, hasRigidbody+PlayerInput - Pickup cubes tagged as
PickUp, haveRotator.cs+ trigger colliders - Enemy tagged as
Enemy, hasNavMeshAgent+EnemyMovement.cs - NavMesh baked for the arena floor
-
CameraControllerassigned the Player GameObject - Canvas has
Count Text(TMP) andWin Textobjects wired toPlayerController
- Clone or download the project
- Open in Unity Hub → select correct Unity version
- Open the main scene (
Assets/Scenes/Main.unityor similar) - Press Play
▶️
- Unity — Game Engine
- C# — Scripting Language
- Unity NavMesh — Enemy AI pathfinding
- Unity Input System — Player controls
- TextMeshPro — UI rendering
Mehmet Anıl Ülkü
Electrical-Electronics & Computer Engineering Student
GitHub: Adonis-Lee
This project was created for educational purposes as part of a Game Programming course.