Roblox Connect is an experience where you can call a friend and have a conversation as your avatars, together in a shared immersive space. From a developer's perspective, it is a non-copylocked experience that demonstrates one way of consuming the call-related methods and events of SocialService and PlayerViewService. The possible use cases are limitless and this guide provides examples of how they're used in Roblox Connect.
Project Overview
Developers can introduce synchronous avatar communication into any experience on Roblox utilizing current methods and events. Some of the noteworthy Roblox Connect feature highlights and call privacy details are shared below.
Environment Switcher
To provide a better immersive communicative experience, the project includes an environment switcher that allows players to move from environment to environment. When moving among environments in the same place, player characters are repositioned via PivotTo(). When moving to an environment in a different place, players are teleported via TeleportService to their desired location.
Additionally, a "handshake" model is implemented to ensure both players in the private space agree to being relocated before actually doing so. If one player declines the request to change environments, the entire transaction is canceled and no players are relocated.
In regards to the call, teleport is to a reserved server and all call participants are teleported together. If this teleport condition is not met, or if the teleport itself fails, the call is ended.
Camera Modes
Roblox Connect introduces two unique camera modes in addition to the default camera mode, both of which you can utilize to enhance your own experiences. Furthermore, when switching between various camera modes, a camera transitioner makes switching between modes feel seamless.
Picture-in-Picture
In picture-in-picture mode, camera focus is on your call partner and a small view of your character floats on the screen. This mode also includes head tracking, and the local player's movement is restricted.
Cinematic
The cinematic mode attempts to keep both player characters within your camera viewport at all times. Player movement is not restricted and, as characters move around, the camera detects their movement and adjusts accordingly.
Freeplay
The freeplay mode uses the default Roblox character camera, letting you move around while also talking to your call partner. Your partner's character will not necessarily be in view.
Emote Bar
The project's emote bar is a cloned version of the EmoteBar developer module. Out of the box, the module contains a lot of key features, but Roblox Connect requires a few specific changes such as returning the character to "idle" state after performing the emote once.
Privacy
If someone who is not in the call is added to the reserved server, or is already in the reserved server, the call is ended.
API Implementation
Roblox Connect takes advantage of new SocialService and PlayerViewService methods and events to build an immersive communication platform.
SocialService:PromptPhoneBook() is hooked up to the call button in the starting lobby so that players may look at their contact list and initiate a call. In tandem, the SocialService.PhoneBookPromptClosed event is connected to a listener that restores the button's visibility and repositions the camera.
The SocialService:CanSendCallingInviteAsync() method is utilized to check if a player is eligible to send call invites. If a player is ineligible (not 13+ and not phone or ID verified), a dialog message is displayed. This check should be made before calling PromptPhoneBook().
The SocialService.CallInviteStateChanged event is connected to a listener that hides the call button, freeing up screen space while the player waits for their friend to answer the call request. This event can be used to show a "connecting" state if desired.
SocialService:ShowSelfView() and SocialService:HideSelfView() are hooked up to various camera modes. Specifically, the caller's self view is shown in Picture‑in‑Picture or Cinematic mode, and hidden in Freeplay mode.
PlayerViewService:GetDeviceCameraCFrame() maps device to workspace camera orientation in Picture‑in‑Picture mode, providing a more immersive experience. This method leverages the player's camera device and is only applicable on mobile devices.