Photo Booth

Taking a photo is a perfect way to commemorate a great experience. The PhotoBooth developer module is an easy-to-use photo staging tool which lets the players strike a unique pose with a background that represents their experience.

Module Usage

Installation

To use the PhotoBooth module in an experience:

  1. Visit the PhotoBooth marketplace page, click the green Get button, and confirm the transaction.

  2. In Studio, open the Toolbox (ViewToolbox).

  3. Select your toolbox Inventory section.

  4. Locate the module item and click it or drag-and-drop it into the 3D view.

  5. In the Explorer window, move the entire PhotoBooth folder into ServerScriptService. Upon running the experience, the module will distribute itself to various services and begin running.

Positioning the Booth

The module comes with one PhotoBooth model that you can position in the 3D world. This model is what players will interact with to set up a photo.

  1. Locate the PhotoBooth mesh inside the Workspace folder of the module's main folder.

  2. Move it into the top-level Workspace hierarchy and position it where desired.

Configuration

The module is preconfigured to work for most use cases, but it can be easily customized through the configure function. For example, to change the default message at the bottom of the photo:

  1. In StarterPlayerScripts, create a new LocalScript and rename it to ConfigurePhotoBooth.

  2. Paste the following code into the new script.

    LocalScript - ConfigurePhotoBooth

    1local ReplicatedStorage = game:GetService("ReplicatedStorage")
    2
    3local PhotoBooth = require(ReplicatedStorage:WaitForChild("PhotoBooth"))
    4
    5PhotoBooth.configure({
    6 frameMessage = "First Photo Booth Capture!",
    7})
    8

Connecting to Events

Every time the photo booth displays a new screen to a local client, a corresponding event is fired. These events can be connected in a LocalScript so that you can respond with your own custom logic.

LocalScript

1local ReplicatedStorage = game:GetService("ReplicatedStorage")
2
3local PhotoBooth = require(ReplicatedStorage:WaitForChild("PhotoBooth"))
4
5PhotoBooth.countdownStarted:Connect(function()
6 print("The countdown has started")
7end)
8
9PhotoBooth.printoutShown:Connect(function()
10 print("The printout is showing")
11end)
12
13PhotoBooth.promptShown:Connect(function()
14 print("The camera prompt is showing")
15end)
16

GUI Visibility

By default, the photo booth hides all ScreenGuis and CoreGuis when a photo is staged. If you want to override this auto-hiding behavior and programmatically decide which GUIs should remain visible, include the hideOtherGuis and showOtherGuis callbacks and respond with your own custom logic.

LocalScript

1local Players = game:GetService("Players")
2local ReplicatedStorage = game:GetService("ReplicatedStorage")
3local StarterGui = game:GetService("StarterGui")
4
5local PhotoBooth = require(ReplicatedStorage:WaitForChild("PhotoBooth"))
6
7local player = Players.LocalPlayer
8local playerGui = player:WaitForChild("PlayerGui")
9local hiddenInstances = {}
10
11-- Create a screen GUI that will not be hidden
12local specialGuiInstance = Instance.new("ScreenGui")
13-- Draw the screen GUI above the photo booth GUI
14specialGuiInstance.DisplayOrder = 1
15specialGuiInstance.Parent = playerGui
16-- Set attribute on screen GUI to prevent hiding
17specialGuiInstance:SetAttribute("ShowInPhotoBooth", true)
18-- Add text label to the GUI
19local specialLabel = Instance.new("TextLabel")
20specialLabel.Size = UDim2.fromScale(1, 0.1)
21specialLabel.Text = "Remains visible when taking a photo"
22specialLabel.Font = Enum.Font.GothamSemibold
23specialLabel.TextSize = 24
24specialLabel.Parent = specialGuiInstance
25
26PhotoBooth.hideOtherGuis(function()
27 -- Hide all developer-defined screen GUIs except those marked with attribute
28 local instances = playerGui:GetChildren()
29 for _, instance in pairs(instances) do
30 if instance:IsA("ScreenGui") and not instance:GetAttribute("ShowInPhotoBooth") and instance.Enabled then
31 instance.Enabled = false
32 table.insert(hiddenInstances, instance)
33 end
34 end
35 -- Hide specific core GUIs
36 StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
37end)
38
39PhotoBooth.showOtherGuis(function()
40 -- Show all developer-defined screen GUIs that were hidden
41 for _, instance in pairs(hiddenInstances) do
42 instance.Enabled = true
43 end
44 hiddenInstances = {}
45 -- Show specific core GUIs that were hidden
46 StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, true)
47end)
48

API Reference

Functions

configure

configure(config:table):nil

Overrides default configuration options through the following keys/values in the config table. This function can only be called from a LocalScript.

Appearance

Key Description Default
frameMessage Message that is shown at the bottom of the photo. Its duration can be controlled via the fadeUiDelay property. "Use your device to take a screenshot and share!"
fadeUiDelay Time to show the frame message before it fades out, in seconds. Set to a negative number to never fade. 3
closeButtonImage Image to use for the close photo button, placed overtop the closeButtonBackgroundImage image. "rbxassetid://7027440823"
closeButtonBackgroundImage Background image to use for the close photo button. "rbxassetid://7027440891"
cameraLandscapePosition Distance of the photo booth's camera, in front and upward from the character, when taking a photo in landscape mode (Vector2). (5, 2)
cameraPortraitPosition Distance of the photo booth's camera, in front and upward from the character, when taking a photo in portrait mode (Vector2). (10, 1)
countdownFont Font to use for the numbers in the countdown (Font). GothamBlack
countdownTextColor Color of the numbers in the countdown (Color3). [255, 255, 255]
printoutCharacterPosition Position of the character on the screen when the printout is showing (UDim2). (0.5, 0, 0.5, 0)
printoutCharacterSize Amount of screen space the character takes up in the printout (UDim2). (1, 0, 1, 0)
characterAnimation Asset ID of the animation the character takes in the photo, paused at its starting frame. "rbxassetid://6899663224"
filterImage Image to apply over the photo as a filter. If nil, a default filter that darkens the image edges will be used. nil

Behavior

Key Description Default
maxActivationDistance Maximum distance, in studs, a player's character can be from the photo booth for the prompt to appear. 10
countdownBeepSound Asset ID of the Sound to play for each number shown in the countdown. "rbxassetid://7743999789"
countdownFlashSound Asset ID for the Sound to play when the flash effect is shown. "rbxassetid://7744000850"
countdownSeconds Number of seconds to count down for. 3

Other

Key Description Default
photoboothTag Tag used by CollectionService to find all "booths" in the place. "PhotoBooth"
LocalScript - ConfigurePhotoBooth

1local ReplicatedStorage = game:GetService("ReplicatedStorage")
2
3local PhotoBooth = require(ReplicatedStorage:WaitForChild("PhotoBooth"))
4
5PhotoBooth.configure({
6 frameMessage = "What a cool pose!",
7 fadeUiDelay = 5,
8 maxActivationDistance = 5,
9 printoutCharacterSize = UDim2.fromScale(1.5, 1.5),
10})
11

setBackgrounds

setBackgrounds(backgrounds:table):nil

Overrides the default backgrounds provided by the photo booth. Background images should be at 16:9 aspect ratio (1024×768) for an optimal experience and their asset IDs should be included in the backgrounds array. 1–4 (inclusive) backgrounds can be provided.

LocalScript

1local ReplicatedStorage = game:GetService("ReplicatedStorage")
2
3local PhotoBooth = require(ReplicatedStorage:WaitForChild("PhotoBooth"))
4
5PhotoBooth.setBackgrounds({
6 "rbxassetid://7018713114",
7 "rbxassetid://950538356",
8})
9

Events

countdownStarted

countdownStarted(): RBXScriptSignal

Fires when the countdown starts. This event can only be connected in a LocalScript.

LocalScript

1local ReplicatedStorage = game:GetService("ReplicatedStorage")
2
3local PhotoBooth = require(ReplicatedStorage:WaitForChild("PhotoBooth"))
4
5PhotoBooth.countdownStarted:Connect(function()
6 print("The countdown has started")
7end)
8

printoutShown

printoutShown(): RBXScriptSignal

Fires when the printout is shown to the user. This event can only be connected in a LocalScript.

LocalScript

1local ReplicatedStorage = game:GetService("ReplicatedStorage")
2
3local PhotoBooth = require(ReplicatedStorage:WaitForChild("PhotoBooth"))
4
5PhotoBooth.printoutShown:Connect(function()
6 print("The printout is showing")
7end)
8

promptShown

promptShown(): RBXScriptSignal

Fires when the printout is closed and the camera button is showing again. This event can only be connected in a LocalScript.

LocalScript

1local ReplicatedStorage = game:GetService("ReplicatedStorage")
2
3local PhotoBooth = require(ReplicatedStorage:WaitForChild("PhotoBooth"))
4
5PhotoBooth.promptShown:Connect(function()
6 print("The camera prompt is showing")
7end)
8

Callbacks

hideOtherGuis

hideOtherGuis(callback:function)

This callback runs immediately before the printout is displayed, letting you disable entire ScreenGuis or elements within them before the printout is shown. GUIs used by the photo booth have the attribute ShowInPhotoBooth set to true. See GUI Visibility for details and sample code.

showOtherGuis

showOtherGuis(callback:function)

This callback runs after the printout has been closed, letting you re-enable entire ScreenGuis or elements within them. GUIs used by the photo booth have the attribute ShowInPhotoBooth set to true. See GUI Visibility for details and sample code.