PcoWSkbVqDnWTu_dm2ix

Photo Booth

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.
  1. Locate the module item and click it or drag-and-drop it into the 3D view.
  2. 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.

This and other developer modules come with an Install script that runs the installer and distributes the contents of the module to the same services that the folders are named after.

The Install script can be utilized as follows:


EnableLogging — Set to true to enable debug logging for the current developer module. This lets you see how the module gets distributed, along with how each package is linked.


InstallStarted — Fires when the installer first starts up. You can hook into this event to run any pre-install steps.


InstallFinished — Fires when the installer has finished installing the module. By this point, the contents of each service folder has been distributed. You can also hook into this event to run any post-install steps.


Install() — Installs the given developer module by overlaying each of the service folders over existing services. For example, a folder named ReplicatedStorage containing a PhotoBooth script will be distributed to game.ReplicatedStorage.PhotoBooth when installing.


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.
  1. 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. 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.
  1. Paste the following code into the new script.

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.

GUI Visibility

By default, the photo booth hides all ScreenGui|ScreenGuis and CoreGui|CoreGuis for the local user when a photo is staged. If you want to override this behavior and keep some GUIs visible, use the hideGui callback and respond with your own custom logic.

API Reference

Functions

configure()

void configure ( table config )

Overrides default configuration options. This function can only be called from a LocalScript.

Key Default Description
frameMessage “Use your device to take a screenshot and share!" Message that is shown at the bottom of the photo. Its duration can be controlled via the fadeUiDelay property.
fadeUiDelay 3 Time to show the frame message before it fades out, in seconds. Set to a negative number to never fade.
cameraIcon "rbxassetid://7022426634" Image for the camera button proximity prompt, placed overtop the cameraBackground image.
cameraBackground "rbxassetid://7027402335" Background image for the camera button proximity prompt.
closeButtonImage "rbxassetid://7027440823" Image to use for the close photo button, placed overtop the closeButtonBackgroundImage image.
closeButtonBackgroundImage "rbxassetid://7027440891" Background image to use for the close photo button.
cameraLandscapePosition Vector2.new(5, 2) Distance of the photo booth's camera, in front and upward from the character, when taking a photo in landscape mode.
cameraPortraitPosition Vector2.new(10, 1) Distance of the photo booth's camera, in front and upward from the character, when taking a photo in portrait mode.
printoutCharacterPosition UDim2.fromScale(0.5, 0.5) Position of the character on the screen when the printout is showing.
printoutCharacterSize UDim2.fromScale(1, 1) Amount of screen space the character takes up in the printout.
characterAnimation "rbxassetid://6899663224" Asset ID of the animation the character takes in the photo, paused at its starting frame.
filterImage nil Image to apply over the photo as a filter. If nil, a default filter that darkens the image edges will be used.
Key Default Description
maxActivationDistance 10 Maximum distance, in studs, a player’s character can be from the photo booth for the prompt to appear.
countdownAudio "rbxassetid://6895448247" Asset ID of the Sound to play for the countdown.
Key Default Description
photoboothTag "PhotoBooth" Tag used by CollectionService to find all "booths" in the place.
useCustomGuiHiding false If true, lets you show or hide other ScreenGui|ScreenGuis using custom logic via the hideGui callback.

setBackgrounds()

void setBackgrounds ( table backgrounds )

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

Events

countdownStarted

RBXScriptConnection countdownStarted ()

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

printoutShown

RBXScriptConnection printoutShown ()

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

promptShown

RBXScriptConnection promptShown ()

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

Callbacks

hideGui

hideGui ( bool shouldHide )

This callback runs immediately before the printout is displayed and again after the printout has been closed. The first time it runs, shouldHide is true, letting you disable entire ScreenGui|ScreenGuis or elements within them before the printout is shown. The second time it runs, shouldHide is false, letting you re-enable the hidden GUIs.


Previous Spawn with Friends