Lesson 2: Unity Project Setup & Version Control
Welcome back, future RPG developer! In this lesson, you'll set up your Unity project with a professional folder structure and establish version control with Git. This foundation will keep your project organized and allow for seamless collaboration as your RPG grows in complexity.
What You'll Learn
By the end of this lesson, you'll have:
- A properly structured Unity project for RPG development
- Git repository set up with best practices
- Collaboration workflow established
- First commit ready for your development journey
Prerequisites
- Unity 2022.3 LTS or newer installed
- Git installed on your system
- Basic understanding of file organization
- Completion of Lesson 1: Project Planning & Scope Definition
Step 1: Create New Unity Project
1.1 Launch Unity Hub
- Open Unity Hub
- Click "New Project"
- Select "3D (Built-in Render Pipeline)" template
- Name your project:
AI-Powered-RPG-Game
- Choose a location outside your Documents folder (recommended:
C:\Projects\
or~/Projects/
) - Click "Create Project"
1.2 Wait for Project Initialization
- Unity will create the project and open the editor
- This may take 2-3 minutes depending on your system
- You'll see the default scene with a Main Camera and Directional Light
Step 2: Organize Project Folder Structure
2.1 Create Main Folders
In the Project window, create these top-level folders:
Assets/
├── 01_Scenes/ # All game scenes
├── 02_Scripts/ # All C# scripts
├── 03_Prefabs/ # Reusable game objects
├── 04_Materials/ # Materials and shaders
├── 05_Textures/ # All texture files
├── 06_Models/ # 3D models and meshes
├── 07_Audio/ # Sound effects and music
├── 08_UI/ # User interface elements
├── 09_AI/ # AI-related scripts and assets
├── 10_Animation/ # Animations and animators
├── 11_Effects/ # Particle effects and VFX
├── 12_Data/ # ScriptableObjects and data files
├── 13_Plugins/ # Third-party plugins
└── 14_StreamingAssets/ # Files accessible at runtime
2.2 Create Subfolders for Organization
Within each main folder, create logical subfolders:
02_Scripts/
├── Player/ # Player-related scripts
├── AI/ # AI and NPC scripts
├── Combat/ # Combat system scripts
├── Inventory/ # Inventory and items
├── UI/ # User interface scripts
├── Managers/ # Game management scripts
├── Utilities/ # Helper and utility scripts
└── Data/ # Data structure scripts
05_Textures/
├── Characters/ # Character textures
├── Environments/ # Environment textures
├── UI/ # UI textures and sprites
├── Effects/ # Effect textures
└── Icons/ # Icon textures
Step 3: Set Up Git Repository
3.1 Initialize Git Repository
- Open your system's terminal/command prompt
- Navigate to your project folder:
cd "C:\Projects\AI-Powered-RPG-Game" # or cd ~/Projects/AI-Powered-RPG-Game
- Initialize Git repository:
git init
3.2 Create .gitignore File
Create a .gitignore
file in your project root with Unity-specific ignores:
# Unity generated files
[Ll]ibrary/
[Tt]emp/
[Oo]bj/
[Bb]uild/
[Bb]uilds/
[Ll]ogs/
[Uu]ser[Ss]ettings/
# MemoryCaptures can get excessive in size
[Mm]emoryCaptures/
# Asset meta data should only be ignored when the corresponding asset is also ignored
!/[Aa]ssets/**/*.meta
# Uncomment this line if you wish to ignore the asset store tools plugin
# /[Aa]ssets/AssetStoreTools*
# Autogenerated Jetbrains Rider plugin
[Aa]ssets/Plugins/Editor/JetBrains*
# Visual Studio cache directory
.vs/
# Gradle cache directory
.gradle/
# Autogenerated VS/MD/Consulo solution and project files
ExportedObj/
.consulo/
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
*.svd
*.pdb
*.mdb
*.opendb
*.VC.db
# Unity3D generated meta files
*.pidb.meta
*.pdb.meta
*.mdb.meta
# Unity3D generated file on crash reports
sysinfo.txt
# Builds
*.apk
*.unitypackage
*.aab
# Crashlytics generated file
crashlytics-build.properties
# Packed Addressables
[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin*
# Temporary auto-generated Android Assets
[Aa]ssets/[Ss]treamingAssets/aa.meta
[Aa]ssets/[Ss]treamingAssets/aa/*
# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
3.3 Configure Git User (if not already set)
git config user.name "Your Name"
git config user.email "your.email@example.com"
Step 4: First Commit
4.1 Add Files to Git
git add .
4.2 Create Initial Commit
git commit -m "Initial Unity project setup with organized folder structure
- Created 3D Unity project for AI-Powered RPG Game
- Organized assets into logical folder structure
- Set up Git repository with Unity .gitignore
- Ready for development workflow"
Step 5: Set Up Collaboration Workflow
5.1 Create GitHub Repository (Optional)
- Go to GitHub.com and create a new repository
- Name it:
ai-powered-rpg-game
- Make it private (recommended for game projects)
- Don't initialize with README (we already have files)
5.2 Connect Local Repository to GitHub
git remote add origin https://github.com/yourusername/ai-powered-rpg-game.git
git branch -M main
git push -u origin main
5.3 Set Up Branch Strategy
# Create development branch
git checkout -b development
# Create feature branch for first feature
git checkout -b feature/player-movement
Mini-Task: Create First Commit
Your Task: Set up your Unity project following the steps above and create your first commit.
Success Criteria:
- ✅ Unity project created with proper folder structure
- ✅ Git repository initialized
- ✅ First commit created with descriptive message
- ✅ All folders organized according to the structure
Share Your Progress: Take a screenshot of your organized Project window and share it in the community Discord channel!
Pro Tips for Project Organization
Folder Naming Conventions
- Use numbers for main folders to control display order
- Use descriptive names that clearly indicate content
- Keep folder names short but clear
- Use PascalCase for script folders, snake_case for asset folders
Version Control Best Practices
- Commit frequently with descriptive messages
- Use branches for different features
- Never commit large binary files (use Git LFS for large assets)
- Review changes before committing
Collaboration Workflow
- Main branch: Stable, working code
- Development branch: Integration branch for features
- Feature branches: Individual features and fixes
- Pull requests: Code review before merging
Common Mistakes to Avoid
❌ Don't Do This
- Put all scripts in one folder
- Commit without .gitignore
- Use generic commit messages like "update"
- Mix different types of assets in the same folder
✅ Do This Instead
- Organize scripts by functionality
- Always use .gitignore for Unity projects
- Write descriptive commit messages
- Keep related assets together
Troubleshooting
Issue: Git Not Recognizing Unity Files
Solution: Ensure you're in the project root directory and .gitignore is properly configured.
Issue: Unity Project Won't Open
Solution: Check that you're using Unity 2022.3 LTS or newer, and the project was created with the correct template.
Issue: Folder Structure Not Showing
Solution: Refresh the Project window (F5) or restart Unity.
What's Next?
In the next lesson, you'll dive into the art pipeline and start creating your first 3D character model. You'll learn how to set up Blender for game development and create assets that will bring your RPG world to life.
Next Lesson: Lesson 3: Art Pipeline & Asset Organization
Related Resources
- Unity Project Organization Best Practices
- Git Workflow for Game Development
- Unity .gitignore Template
Community & Support
Need Help? Join our Discord community for real-time support and feedback on your project setup.
Share Your Progress: Post screenshots of your organized project structure and get feedback from fellow developers.
Bookmark this lesson for quick reference when setting up future Unity projects. The folder structure you create today will save hours of organization time as your RPG grows in complexity.
Share this lesson with other developers who are starting their Unity journey. A well-organized project is the foundation of successful game development!