Setting the teleport GUI from the client

Hey Developers!

We’ve been working on some awesome new features over summer to simplify some common workflows! Here is the first of more to come.

Presenting SetTeleportGui: This feature allows you to set a custom GUI shown to players while teleporting, before invoking the teleport.

Here’s an example of how you can use this feature in conjunction with the server.

-- Client
local teleportGui = ... -- Some GUI
local teleportService = game:GetService("TeleportService")
local prepare = game:GetService("ReplicatedStorage"):WaitForChild("TeleportPrepare")

prepare.OnClientEvent:Connect(function ()
  -- Show teleportGui
end)

teleportService:SetTeleportGui(teleportGui)
-- Server
local teleportService = game:GetService("TeleportService")
local prepare = Instance.new("RemoteEvent")
prepare.Name = "TeleportPrepare"
prepare.Parent = game:GetService("ReplicatedStorage")

local function teleportParty(placeId, players, ...)
  for _, player in ipairs(players) do
    prepare:FireClient(player)
  end
  wait(2)
  teleportService:TeleportPartyAsync(placeId, players, ...)
end

How does it work?

When you set a GUI, a reference is stored; then when you invoke the teleport, a copy is created and shown to the player.

This feature is enabled on all platforms

Stay creative developers!

55 Likes

Is this meant to deprecate customLoadingScreen in functions like TeleportService:Teleport()?

1 Like

customLoadingScreen will not be deprecated for the time being, however generally speaking you should use this method instead.

3 Likes

Will this overshadow the topbar’s “refreshing” when you teleport? That was mainly the biggest issue with seamless teleports

6 Likes

There are no changes in behavior introduced by this update.

1 Like

Ah, any plans to fix that? Basically everything is great about the custom teleport UIs except for the Topbar influence. Since the topbar is basically removed and then once the client connects to the new server, it re-adds the topbar

7 Likes

There are plans to stop the topbar causing your GUI to ‘bump’ when teleporting. As for making the topbar itself seamless I do not believe so but will look into it.

4 Likes

Can’t you just offset the teleportscreen by -35 or whatever it is? I do that with a pitch black screen and it’s seamless with fading in and out of teleports.

No, that doesn’t work. The problem is if you’re referencing Y position of UI elements from the top bar inset, and the top bar temporarily vanishes between teleports, it can cause some of the UI elements on your teleport screen to glitch up and down briefly because the top bar inset changes, which doesn’t look great.

3 Likes

Just to clarify, this is what I was referring to when I said ‘bump’ in my previous reply.

2 Likes

You will be able to stop your GUI ‘bumping’ with the following change.

6 Likes

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.