A first-person survival horror game built with Unity. You wake in a darkened apartment with something hunting you — flicker through the halls, find the pistol, ration your ammo, and escape before the dead catch up.
This repository contains the Unity game project and a website that hosts and plays a WebGL build of the game in the browser.
.
├── Don't be scare/ The Unity project
│ ├── Assets/
│ │ ├── Animations/ Doors, torches, pistol, screen fades
│ │ ├── Audio/ FX (door, pistol) and zombie growls
│ │ ├── Materials/ Walls, rock, fire, menu art
│ │ ├── Object/ Models: ammo box, apartment door, zombie
│ │ ├── Player/ Mini First Person Controller
│ │ ├── Scenes/ MainMenu, Scene1, CreditScene
│ │ └── Scripts/ Game logic (see below)
│ ├── Packages/ Unity package manifest
│ └── ProjectSettings/ Unity project settings
│
├── website/ Browser player for the WebGL build
│ ├── index.html Landing page
│ ├── play.html Game player page
│ ├── css/ · js/ Styling + Unity loader bootstrapper
│ ├── Build/ ← drop the WebGL build here
│ └── README.md Website-specific build/run guide
│
└── README.md This file
- Engine: Unity 2022.3.27f1 (LTS)
- Product name:
Don't be scare - Key packages: TextMeshPro, Timeline, uGUI, Visual Scripting
(see
Don't be scare/Packages/manifest.json)
The game loads scenes by build index, so order matters in File ▸ Build Settings ▸ Scenes In Build:
| Index | Scene | Purpose |
|---|---|---|
| 0 | MainMenu |
Title screen / New Game button |
| 1 | CreditScene |
Shown after the play sequence (ToMenu loads index 1) |
| 2 | Scene1 |
The main playable apartment level |
If scenes load in the wrong order, re-check the Build Settings list — the scripts reference indices directly (
SceneManager.LoadScene(1)/(2)).
Game logic lives in Don't be scare/Assets/Scripts/, organized by area:
| Folder | Script | Responsibility |
|---|---|---|
Player/ |
PlayerCasting |
Raycasts forward, publishes distance to targets |
Weapons/ |
FirePistol |
Fires the pistol, applies damage, rate-limited |
Weapons/ |
PickUpPistol |
Pick up the gun via the Action key |
Weapons/ |
AmmoPickUp |
Ammo box trigger, adds to ammo count |
Weapons/ |
GlobalAmmo |
Tracks ammo count, updates the HUD text |
Enemies/ |
ZombieDeath |
Zombie health, death animation, cleanup |
Environment/ |
DoorOpen |
Interactable doors |
Environment/ |
FlameAnimation |
Random torch flicker animation |
UI/ |
ToMenu |
Timed transition to the next scene |
Menu/ |
MainMenuFunction |
Main menu New Game flow |
Sequences/ |
FirstTrigger, CubeTrigger, CubeTrigger01, Sequences_01 |
Scripted scares and intro sequence |
| Input | Action |
|---|---|
W A S D |
Move |
| Mouse | Look around |
Action key (default E) |
Interact / pick up / open doors |
Left Click (Fire1) |
Fire pistol |
Esc |
Release mouse |
- Install Unity 2022.3.27f1 via Unity Hub.
- Open the
Don't be scarefolder as a project. - Open
Assets/Scenes/MainMenu.unityand press Play.
The website/ folder is a ready-made player for a WebGL build of the game.
Building WebGL requires the Unity Editor — it compiles scenes, assets, and C#
into WebAssembly, so it can't be produced from the scripts alone.
Quick version:
- In Unity: File ▸ Build Settings ▸ WebGL ▸ Build.
- Copy the contents of Unity's output
Build/folder intowebsite/Build/, namedDontBeScared.*(or setBUILD_NAMEinwebsite/js/game.js). - Serve over HTTP from the
website/folder:Then open http://localhost:8080.python -m http.server 8080
Full instructions, deployment notes, and troubleshooting are in
website/README.md.
Unity WebGL must be served over HTTP — opening the pages with
file://will not work. Before adding a build, the player page shows a clear "No game build found" notice instead of erroring.
- Website shell (no build needed): serve
website/and confirm the landing page, navigation, styling, and the "No game build found" notice all work. - Full game in browser: add the WebGL build, then verify the loading bar, input/mouse lock, controls, and fullscreen.
- Gameplay logic: runs in the Unity Editor's Play mode — e.g. confirm the pistol is rate-limited to one shot per ~0.5s and that a zombie's death sequence plays once when its health reaches 0.
Library/is Unity's local cache and is regenerated automatically; it should not be edited by hand (and is typically git-ignored).- The website is not affiliated with Unity Technologies.