A complete 3D platformer game created in Unity featuring player movement, collectibles, moving platforms, and comprehensive game mechanics.
- 3D Player Movement: WASD movement with space bar jumping and CharacterController physics
- Third-Person Camera: Mouse look with smooth camera controls
- Collectible System: Rotating coins with bob animations and sound effects
- Moving Platforms: Platforms that move between waypoints with player attachment
- Game Timer: 3-minute gameplay sessions with countdown
- Score System: Collect items to increase score and win condition
- Pause Menu: Press P or Escape to pause/resume
- Complete UI: Score display, timer, game over screens
- Automatic Level Generator: LevelEditor script for quick scene setup
- Clone this repository
- Open Unity Hub and click "Add project from disk"
- Select the project folder
- Open in Unity 2022.3.7f1 or later
- Use LevelEditor script for automatic level generation, OR
- Follow manual setup instructions below
- Press Play to start the game!
- Character movement using Unity's CharacterController
- Ground detection and jumping mechanics
- WASD movement with gravity simulation
- Mouse look integration for camera-relative movement
- Third-person camera that smoothly follows the player
- Mouse control for horizontal and vertical rotation
- Configurable sensitivity and angle limits
- Cursor lock/unlock functionality
- Rotating collectible items with visual appeal
- Smooth bobbing animation using sine waves
- Sound effects and particle effects support
- Automatic score integration with GameManager
- Central game state management
- Score tracking and win/lose conditions
- Timer system with formatted display
- Pause functionality and game restart
- UI management for all game screens
- Platforms that move between configurable waypoints
- Player attachment system for realistic platform riding
- Customizable movement speed, wait times, and patterns
- Visual gizmos for waypoint debugging
- Automatic level generation tool
- Creates complete playable scenes with one click
- Generates player, platforms, collectibles, UI, and game manager
- Perfect for rapid prototyping and testing
- Create an empty GameObject named "LevelGenerator"
- Add the
LevelEditorscript to it - Right-click the script in Inspector
- Select "Generate Basic Level" from context menu
- Everything will be created automatically!
- Create Capsule GameObject, rename to "Player"
- Add tag "Player" to the GameObject
- Remove Capsule Collider, add CharacterController
- Add PlayerController script
- Set position to (0, 2, 0)
- Select Main Camera
- Add CameraController script
- Drag Player object to "Target" field
- Create Cube GameObjects for platforms
- Set layer to "Ground" (create if needed)
- Add MovingPlatform script for moving platforms
- Position at various heights
- Create Cylinder GameObjects
- Scale to (0.8, 0.3, 0.8)
- Enable "Is Trigger" on Collider
- Add Collectible script
- Distribute around the level
- Create empty GameObject named "GameManager"
- Add GameManager script
- Create UI Canvas with Text elements for score/timer
- Assign UI elements to GameManager script
- WASD / Arrow Keys: Move player
- Space: Jump
- Mouse: Look around / Camera control
- P / Escape: Pause/Resume game
- R: Restart game
- Escape: Toggle cursor lock
Player Movement:
- Adjust
moveSpeed,jumpForce, andgravityin PlayerController - Modify ground detection distance and layer mask
Camera Feel:
- Change
mouseSensitivityand angle limits in CameraController - Adjust
smoothSpeedfor camera follow responsiveness
Game Settings:
- Modify
gameTimeandtotalCollectiblesin GameManager - Customize collectible animations and effects
- Add new platform movement patterns
Visual Enhancement:
- Create materials in Assets/Materials folder
- Add particle effects for collectibles
- Implement sound effects and background music
- Go to File > Build Settings
- Add Open Scenes to include your game scene
- Select target platform (PC, Mac, Linux, etc.)
- Configure Player Settings if needed
- Click Build and choose output folder
- Run the executable to play your game!
Unity-Game/
├── Assets/
│ ├── Scenes/
│ │ ├── MainGame.unity
│ │ └── GameScene.unity
│ ├── Scripts/
│ │ ├── PlayerController.cs
│ │ ├── CameraController.cs
│ │ ├── Collectible.cs
│ │ ├── GameManager.cs
│ │ ├── MovingPlatform.cs
│ │ └── LevelEditor.cs
│ ├── Materials/ (for your custom materials)
│ └── Prefabs/ (for reusable game objects)
├── ProjectSettings/ (Unity configuration)
├── README.md
├── UNITY_SETUP_GUIDE.md
└── .gitignore
Goal: Collect all coins within the 3-minute time limit!
- Navigate through platforms using WASD movement
- Jump between platforms with precise timing
- Use moving platforms to reach higher areas
- Collect all rotating coins to win the game
- Beat the clock for the ultimate challenge!
- Unity Version: 2022.3.7f1 or later (LTS recommended)
- Platform: Windows, Mac, or Linux
- Dependencies: Standard Unity 3D project packages
- Input System: Unity Legacy Input Manager
- Physics: Unity 3D Physics with CharacterController
Player falls through ground:
- Ensure platforms have "Ground" layer assigned
- Check PlayerController groundMask includes "Ground" layer
Camera doesn't follow:
- Verify CameraController target is assigned to Player
- Check Player GameObject is active in scene
Collectibles don't register:
- Confirm Collider "Is Trigger" is enabled
- Verify Player has "Player" tag assigned
- Check Collectible script is attached
Scripts show as missing:
- Ensure all scripts are in Assets/Scripts folder
- Wait for Unity to finish importing scripts
- Check Console window for compilation errors
- Add enemies and combat mechanics
- Implement multiple levels and progression
- Add power-ups and special abilities
- Create main menu and level selection
- Add achievements and leaderboards
- Implement save/load functionality
- Add visual and audio polish
Enjoy building and playing your Unity 3D Platformer Game! 🎮✨
Feel free to modify, extend, and make it your own. Happy coding!