Reading time: ~20 minutes
New to CORP? See the README for an overview of features and architecture.
Prerequisites
Before starting, ensure you have:- Node.js (v14 or higher)
- Visual Studio Code (recommended IDE)
- Git for cloning the template
- Roblox Studio installed
Step 1: Install Required Tools
Install VS Code Extensions
Install these essential VS Code extensions:-
roblox-ts Extension
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for “roblox-ts”
- Install roblox-ts by roblox-ts
-
Rojo Extension
- Search for “rojo” in Extensions
- Install Rojo by evaera
Install Rojo Studio Plugin
- Go to Rojo Releases
- Download the latest
Rojo.rbxmfile - In Roblox Studio, go to Plugins folder:
- Windows:
%LOCALAPPDATA%\Roblox\Plugins - Mac:
~/Documents/Roblox/Plugins
- Windows:
- Place
Rojo.rbxmin the Plugins folder - Restart Roblox Studio
- You should see the Rojo plugin in the toolbar
Step 2: Clone the Template
Start by cloning the CORP template repository:- CORP framework as a git submodule
- Pre-configured project structure
- Default Gamepack ready to customize
- Bootstrap scripts for client and server
Step 2: Initialize Submodules
Initialize the CORP submodule:CORP/ directory.
Step 3: Install Dependencies
Install npm dependencies:Step 4: Configure Your Game
Update Gamepack Name
OpenGAMEPACKS/MYGAME/metadata.ts and update the name:
Update Game Configuration
OpenGAMECONFIG/gameinfo.ts and update the root pack:
Step 5: Your Project Structure
Your project now has this structure:Step 6: Create Your First Component
Components define behavior for GameObjects. Let’s create a simple component.Create the Component File
CreateGAMEPACKS/MyFirstGame/src/HelloWorld.ts:
Export the Component
OpenGAMEPACKS/MyFirstGame/exports/components.ts and add your component:
Step 7: Set Up the Game Scene
Configure Boot Settings
OpenGAMEPACKS/MyFirstGame/exports/bootconfig.ts:
Create a Scene in Roblox Studio
- Open your game in Roblox Studio
- Create a Folder in
Workspace - Rename it to something like “GameScene”
- Add a Tag to this folder:
GameObjectSceneRoot- Install the Tag Editor plugin if you don’t have it
- Inside this folder, create a Folder named “TestObject”
- Add a tag to “TestObject”:
GameObject
Note: TheGameObjectSceneRoottag tells CORP where to find your scene root. TheGameObjecttag marks instances that should become GameObjects.
Step 8: Build and Test
Start the Development Workflow
CORP uses Rojo to sync your code to Roblox Studio in real-time. You need two terminals: Terminal 1 - Start Rojo Server:
Tip: You can use npm run watch if your package.json has a watch script configured.
Connect Roblox Studio to Rojo
- Open your game in Roblox Studio
- Click the Rojo plugin button in the toolbar
- Click Connect (it should auto-detect
localhost:34872) - You should see “Connected to Rojo” with a green indicator
Test Your Game
- Make sure your workspace scene is set up (Step 7)
- Click Play (F5) in Roblox Studio
- Check the Output window
Development Workflow Tips
- Keep both terminals running while developing
- Save your TypeScript files and they’ll auto-compile and sync to Studio
- Don’t manually edit Roblox instance names - let Rojo manage the sync
- Use Output window for debugging with
print()statements - Restart the Rojo connection if you add new files/folders
Understanding What Happened
Let’s review what just happened:- Bootstrap Process: The client and server entry points call
Unreal.bootstrap() - Manifest Creation: CORP reads your Gamepack and creates a manifest of all components
- Boot Config: The
startFromWorkspace: truesetting tells CORP to load from the workspace - Scene Loading: CORP finds the
GameObjectSceneRoottag and converts tagged instances to GameObjects - Component Initialization: Your
HelloWorldcomponent’sonStart()method is called
Component Lifecycle Explained
Understanding the component lifecycle is crucial:- Constructor: Component is instantiated
- Don’t access other components here!
- willStart(): Pre-initialization hook (optional)
- onStart(): Main initialization
- Safe to access other components
- Set up your game logic here
- onPropertiesApplied(): Called after serialized properties are applied (optional)
- willRemove(): Cleanup before destruction
- Disconnect events, clean up resources
- remove(): Component is destroyed
Working with GameObjects at Runtime
While the workspace-based approach is great for level design, you can also create GameObjects dynamically:Next Steps
Now that you have a working CORP game, here’s what to learn next:Learn Core Concepts
- Core Concepts: Deep dive into GameObjects, Components, and Behaviors
- Unreal System: Understanding Gamepacks and project organization
- Decorators: Using @SerializeField, @RequiresComponent, and more
Add Game Features
- Examples: Build player controllers, health systems, and weapons
- Scene Management: Advanced scene loading and serialization
- Macros: Transform Roblox instances into GameObjects procedurally
- ScriptableObjects: Create reusable data assets
Add Multiplayer
- Networking: NetworkObjects, NetworkBehaviors, and RPCs
- Advanced Topics: Ownership, spawn management, and optimization
Troubleshooting
”No scene root found in workspace”
Solution: Make sure you’ve tagged a Folder in Workspace withGameObjectSceneRoot.
”Component not found in manifest”
Solution:- Check that your component is exported in
exports/components.ts - Verify the mapping name matches what you’re using
- Rebuild your project (
npm run build)
Component’s onStart() not being called
Solution:- Verify bootstrap is running (check for any errors in Output)
- Ensure the GameObject has the proper tags in workspace
- Check that the component export mapping is correct
”CORP is not defined” or import errors
Solution:- Run
git submodule update --init --recursive - Verify the CORP folder exists in your project root
- Check your
tsconfig.jsonpaths configuration
Changes not reflecting in-game
Solution:- Make sure
npm run watchis running (or rebuild withnpm run build) - In Roblox Studio, stop and restart the play session
- Check the Output window for compilation errors
Tips for Success
✅ Best Practices
- Initialize in onStart(): Never access other components in the constructor
- Use @RequiresComponent: Enforce component dependencies declaratively
- Clean up in willRemove(): Disconnect events and free resources
- Use snake_case for mappings: Component exports should use
snake_casenames - Match Gamepack names: Ensure
metadata.tsname matchesgameinfo.tsrootPack
🎯 Common Patterns
Quick Reference
See the README for:- Common imports
- Component templates
- NetworkBehavior templates
- Architecture overview
- Best practices
Support and Resources
- GitHub Repository: Source code and issues
- API Reference: Complete API documentation
- Examples: Practical code examples
🚀 You’re ready to build amazing games with CORP! Continue with Core Concepts to deepen your understanding.