Roblox Game Delelopment in 24 Hour
Roblox Game Delelopment in 24 Hour
Roblox Game Delelopment in 24 Hour
m
pl
e
pa
ge
s
Table of Contents
s
What’s Inside Roblox’s Engine ................................................................. 10
ge
Free, Free, Free . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Unlimited Possibilities .............................................................................. 14
Express Your Own Aesthetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
pa
HOUR 2: Using Studio 19
Installing Roblox Studio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
e
Snapping ................................................................................................ 34
Collisions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Sa
Anchoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Saving and Publishing Your Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Playtesting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
s
HOUR 6: Lighting Environment 107
Properties of World Lighting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
ge
Using Lighting Effects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Using SpotLight, PointLight, and SurfaceLight . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
pa
HOUR 7: Atmosphere Environment 123
Using Atmosphere Properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Customizing Skybox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
e
pl
s
Debugging Code ................................................................................... 209
ge
HOUR 12: Collisions, Humanoids, Score 215
Introduction to Collisions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
pa
Detecting Collisions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Introduction to Humanoids. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
e
Layouts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
Making a GUI Countdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
s
Introduction to Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
ge
Teleportation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
TeleportService ...................................................................................... 318
Using Persistent Data Stores . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
pa
Data Store Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
Protecting and Responding to Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
e
s
HOUR 23: Monetization 395
ge
Game Passes: One-Time Purchases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
Selling Your Game Pass in Game. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
pa
Developer Products: Consumables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
Roblox Premium . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
Developer Exchange: Earn Real Money from Your Game . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
e
Analytics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
Index 433
HOUR 2
Using Studio
s
How to use Studio templates
How to navigate game editor
ge
How to create a part
How to translate, scale, and orient parts
pa
How to save and publish your project
Playtesting
e
pl
Now that we’ve explored the culture and features that make Roblox special, you can start to
unleash your creativity with Roblox’s free game engine, Roblox Studio. Roblox Studio is a play-
m
ground for developers to create, share, and play their games on the Roblox website. What’s
great about this platform is that you can easily build everything from volcanic islands to urban
cityscapes and then drop a character into that world to immediately start playing. Imagine a
Sa
huge playground filled with all the tools you need to build imaginary worlds—that’s Roblox
Studio.
In this hour, you’ll learn how to install Studio, and then you’ll learn how to use Roblox Studio
with the help of templates. You’ll also learn how to arrange your workspace to hold objects in
the 3D world, the difference between saving and publishing your project, and finally how to test
your game before publishing it to the public.
1. Go to https://www.roblox.com/create.
2. Click Start Creating and then click the Download Studio button in the pop-up window.
3. Navigate to the folder where you have downloaded Studio and double-click the file to
install it.
NOTE
System Requirements
For Roblox Studio to run efficiently, there are some OS/hardware specifications:
s
Roblox Studio cannot run on Linux, Chromebooks, or mobile devices such as smartphones.
ge
A Windows computer with at least Windows 7 installed, or a MacBook with version
macOS10.10.
A minimum of 1 GB of system memory.
pa
Internet access to download Studio and updates. It also lets you save projects (publish) to
your Roblox account.
For an enhanced Studio experience, you should also have these things (not mandatory):
A mouse with a scroll wheel, preferably a three-button mouse.
e
flicts, there are a few things you can do to troubleshoot the errors:
If you’ve added new hardware or drivers recently, remove and replace the hardware to
determine if it’s causing the problem.
Run diagnostics software and check information on troubleshooting the operating system.
Uninstall and delete all the Roblox files and reinstall the latest Studio again, if required.
If you are still finding errors, you can also reference the Roblox Support forums online for addi-
tional tips.
Installing Roblox Studio 21
1. Double-click the desktop icon if you are on Windows or click the Dock icon if you are on a
Mac to open a login window (Figure 2.1).
s
ge
pa
e
pl
m
Sa
FIGURE 2.1
Roblox Studio login window.
Once you are logged in, you see a page with different templates and a menu sidebar with New,
My Games, Recent, and Archive (Figure 2.2).
The following sections provide a quick introduction to these templates and the rest of Studio;
then you can begin experimenting with the utilities of Studio.
22 HOUR 2: Using Studio
s
ge
FIGURE 2.2
Roblox Studio home screen.
pa
Using Studio Templates
e
When you first open Roblox Studio, under New, you see three tabs: All Templates, Theme, and
Gameplay. Templates are prebuilt projects, and you can use them as a guide to build your own
pl
game world.
m
All Templates
Sa
The All Templates tab (Figure 2.3) is a combination of the Theme and Gameplay tabs. You can
use these templates as a start for your games. For example, if you’re building a medieval game,
the Castle theme is equipped with feudal details, or if you want to build an interactive obby, you
can build off the Obby gameplay template. Two simple templates are a good place to start:
Baseplate: This is a popular choice to start with. The baseplate itself is easy to delete, leav-
ing a blank canvas to work with.
Flat Terrain: Has a flat plane of grass terrain instead of a baseplate. You can modify or
clear the terrain using the terrain editor.
Using Studio Templates 23
FIGURE 2.3
s
Roblox Studio home screen lists various templates available, such as simple templates Baseplate and Flat
Terrain.
Themes
ge
pa
Themes are a combination of gameplays and more, and together they make a new world. It sets
a mood for your game—for example, a space combat game will have asteroids and other galac-
tic components. Roblox provides some prebuilt themes that are ready to use and modify however
you would like. As you explore the game world, descriptions point out its use case or features,
e
including tips on how the effects were created in case you want to re-create them yourself.
pl
An example of a prebuilt theme is Village (Figure 2.4). You can explore the houses in the village
and move along the pathway through the town, which leads you to a river, a bridge, and finally
m
FIGURE 2.4
Example of a prebuilt Village Theme available in Studio.
24 HOUR 2: Using Studio
Gameplay
Some templates include interactive gameplay. For example, this can include Team Deathmatch,
Control Points, Capture the Flag (Figure 2.5), and more. A great thing about these templates is
that developers can take them apart and extract any specific facet that they want—for example,
using in-game radar or team spawn points. These templates help with components such as what
a player can do in a game, what the goals are, and how a game can be modified.
s
ge
pa
e
pl
m
FIGURE 2.5
Example of a prebuilt Capture the Flag gameplay template.
Sa
The game editor is, as the name suggests, a place where you can create, modify, or test your
game. At the top of the game editor, you see different tabs on the menu bar (Figure 2.7).
Working with the Game Editor 25
s
FIGURE 2.6
ge
The game editor enables you to create, modify, or test your game.
pa
FIGURE 2.7
Roblox Studio menu bar.
e
Home tab: A concise tab of all the features that are frequently used. These features are on
the Home tab for easy access.
pl
Model tab: Has more building tools apart from move, scale, and rotate. It’s also where you
m
can create spawn locations and special effects such as fire and smoke.
Test tab: Helps for testing your game. There are two options underneath: Run and Play.
Sa
Run will run a simulation of what will happen to the bricks and surrounding elements,
and Play will let you play your game.
View tab: Lets you toggle the different windows available in the Roblox Studio. If you need
to use a window that is closed, you can find them under the View tab.
The main windows are Explorer and Properties, which are discussed detail in later in
this section.
The Actions section has several display features. You can take screenshots or record
videos here and also toggle between full screen and windowed views.
Plugins tab: An add-on to Studio. These are generally not included by default. Plugins
add new custom behavior and features. You can either install plugins made by the Roblox
community or create your own plugins.
26 HOUR 2: Using Studio
Below the menu bar is a ribbon bar (Figure 2.8). The tool options change as you move between
menu bar tabs.
FIGURE 2.8
Roblox Studio ribbon bar.
In the following sections, we explain some of the editor’s basic features and most frequently used
features and discuss how to prepare your project for publishing on Roblox.
s
Arranging the Game Editor Workspace
ge
Since this is the first time you are opening the game editor, extra windows that you don’t require
right now will automatically open on the left side. To organize the workspace in an optimal
way, close the extra windows so you have more space to create.
pa
By default, the Explorer and the Properties windows will be open (Figure 2.9), aligned one
beneath the other on the right side.
e
pl
m
Sa
FIGURE 2.9
Workspace arrangement with the Explorer and Properties windows one below the other.
Working with the Game Editor 27
NOTE
Some Features of the Game Editor Workspace
The next time you relaunch Roblox Studio, your workspace arrangement remains intact. It is a one-
time fix, unless you undo your arrangement.
When the Property window undocks, it gets difficult to dock it back below the Explorer window. It
either docks itself aside or over the Explorer window. To fix this, undock both the windows and close
them. Go to the View tab, open the Explorer window, dock it on the right-hand side, and then close
it. Do the same with the Properties window and close it. After all this, reopen the Explorer and then
the Properties window. This will align them one above the other.
s
The Explorer window is the hierarchical representation of all the objects used in your game. It
ge
is the most crucial window because it lists all the organizing, viewing, and testing features of a
Roblox game.
pa
It uses the concept of parenting to organize all the objects. The object Game is hidden at the top
of the hierarchy. For example, in Figure 2.10, you can see Workspace parent has the following
children nested underneath: Camera, Terrain, and Baseplate.
e
pl
m
Sa
FIGURE 2.10
Objects nested under Workspace in the Explorer window.
If you want to create more child objects, you can hover over Workspace and click the plus sym-
bol to the right (Figure 2.11). This will list all the objects that you can create. You can also drag
and drop it into the desired parent object.
28 HOUR 2: Using Studio
s
ge
FIGURE 2.11
Add more children to your Workspace.
pa
One of the most important children you will work with is a part, which is the foundational
building block of Roblox. These physical 3D objects are also known as bricks, and when they are
in the Workspace, they can interact with each other.
e
pl
Creating a Part
To create a part, from the Home tab, navigate to the Insert menu in the ribbon bar and click
m
FIGURE 2.12
Create a part.
A part will appear at the exact center of your camera view (Figure 2.13). Use the camera con-
trols shown in Figure 2.14 to move your camera, rotate the view, and zoom in and out.
Working with the Game Editor 29
FIGURE 2.13
Part appears in your baseplate and in your Explorer.
s
ge
pa
e
pl
FIGURE 2.14
Camera controls.
m
2. Rename the part. Roblox convention is for parts to be named in PascalCase, which means
the first letter is capitalized—for example, EndZone or RedBrick.
Note that your name can contain spaces, but we won’t use spaces at this point in case we want
to be able to access the part via code later.
You can use the Explorer to select and work with parts even if you can’t see them in the game
editor window.
FIGURE 2.15
The Properties window lists all the details about the newly added part.
s
Like any object, a part has properties such as size and color, and the Properties window shows all
ge
these details about how an object looks and behaves. In the next chapter, we’ll go into further
detail about properties of a part and how you can manipulate them.
pa
Translating, Scaling, and Orienting Objects
You’ve learned how to create a part; now you can make it move! In Roblox Studio, it is possible to
e
move (translate) and rotate (orient) objects in the scene. There are multiple ways to get the same
results, but in this section, we will solely use the Roblox Studio default tools and keyboard shortcuts.
pl
There are two settings you can use to get greater control when moving parts: snapping and collisions.
m
Snapping is the amount a part will move, scale, or rotate at a time. Snapping is useful
when creating items that need to be exactly aligned, like how walls of buildings need to be
Sa
at 90-degree angles.
Collisions happen when two objects (or rigid bodies) intersect or get within a certain range
of each other.
Because these two settings are most used when playing with two or more parts, turn them off for
now while you freely move a single part around. Later, you’ll turn them back on when we discuss
how they work.
To turn OFF snap: In the Model tab, uncheck the box next to Rotate or Move (Figure 2.16).
FIGURE 2.16
Turn off snap.
Translating, Scaling, and Orienting Objects 31
To turn OFF collisions: In the Model tab, collisions are on if the button is highlighted
gray. Click the Collisions button to toggle it off (Figure 2.17).
FIGURE 2.17
Turn off collisions.
Translating
s
ge
Now you can freely start translating, or moving, objects. Go to the Model or Home tab and click
the Move icon (Figure 2.18). pa
e
pl
FIGURE 2.18
Move tool.
m
Now, a gizmo should appear on the selected objects. When you click, hold, and drag one of the
arrows, the object moves along that axis (Figure 2.19).
Sa
FIGURE 2.19
Moving the gizmo.
32 HOUR 2: Using Studio
Scaling
To scale objects, go to the Model or Home tab and click the Scale icon (Figure 2.20).
FIGURE 2.20
Scale tool.
The gizmo should appear again, this time with orbs on selected objects. When you click, hold,
s
and drag one of the orbs, the object scales along that axis (Figure 2.21).
ge
pa
e
pl
FIGURE 2.21
Scaling a gizmo.
m
If you want to scale on two sides simultaneously, hold Ctrl (Windows) or Command (Mac) while
Sa
If you want to scale while keeping the current proportions, you can do so by holding Shift while
scaling.
Rotating
To rotate objects, go to the Model or Home tab, and click the Rotate icon (Figure 2.22).
FIGURE 2.22
Rotate tool.