Teleporting a player to the PlaceId they're currently in does not work 100% of the time

Issue Type: Connectivity
Impact: High
Frequency: Often
Date First Experienced: 2021-02-21 01:02:00 (-05:00)
Date Last Experienced: 2021-02-21 12:02:00 (-05:00)

Reproduction Steps:

  1. Create a script that teleports a player to the same PlaceId that they’re currently in
  2. Ensure there is only one public server of that PlaceId
  3. Observe player is teleported into the same server instance, observe core Roblox + custom functionality is immensely broken

Expected Behavior:
Player is teleported into the same PlaceId with full functionality. I do this in order to quickly reload the level if a player wishes to restart.

Actual Behavior:
Core Roblox + custom functionality is immensely broken. Scripts refuse to load. You eventually time out.


Note the Developer Console never loads the server/client tabs, my character cannot jump, and my NPCs walk in place. I assume the server is still in “shutdown mode” from when you were leaving.

Workaround:
Reserving a private server seems to lower the occurrence of this issue. I do not want to reserve a private server, as that will make players be alone.

4 Likes

We’re looking into this. If possible, we would like some more information:

  • What place does this occur in?
  • Which teleport method are you using?
  • Are you initiating the teleport from the client or server?
  • Are you eventually shown a disconnection prompt?
  • Do you have any code running on close?
  • When the teleport finishes, have you definitely joined/rejoined the game?
5 Likes

Are you the only player on the server when you teleport or are there other players?

I think what happens if you’re the only player is:

  1. You leave the server during teleport
  2. Roblox shuts down the now empty server
  3. You may or may not arrive at the server that Roblox is shutting down. If you do arrive, the server is in shutdown mode and so your code won’t be running
3 Likes

What place does this occur in?

Which teleport method are you using?
game:GetService("TeleportService"):Teleport(game.PlaceId)

Are you initiating the teleport from the client or server?
The client.

Are you eventually shown a disconnection prompt?
No. I waited about five minutes and nothing.

Do you have any code running on close?
Yes. I save data using game:BindToClose

When the teleport finishes, have you definitely joined/rejoined the game?
I don’t know. This is a video of it if it helps:

I believe it loads the game on the client, but doesn’t connect to a server. Notice how the developer console never fully initializes as well as there’s no server displayed on the website.

2 Likes

Great, I was able to reproduce this from the information you provided. I’ll let you know when we have further updates.

5 Likes

hey @cloakedyoshi,

We’ve been having several discussions about this, and we believe that the traditional teleport is working as expected in this scenario. The goal of teleport is to take the player to the “best” live server it can find at the time for a given place but because of this particular scenario and the brief moment that the server is empty, it’s marked to be shut down during the teleport. Teleport wasn’t designed to “reset” a place as there are other implications and edge cases that developers may use the same mechanic for.

However, to solve your immediate use-case, there are some ways to get around this:

  • as you mentioned before, you can use private servers
  • you can introduce an in-between “loading” place that you can temporarily move a player to, then teleport them back to the original place (this wouldn’t always guarantee a “reset” however due to teleport mechanics)
  • you may need to introduce a “reset” mechanism in your game that reloads the assets you want to reset

Unfortunately we do not provide an easy API to simply reset a place at this time. I plan on bringing it up to the team but I don’t have any promises as to when it can be available, unless there’s great demand for it. We may actually remove the ability to teleport to the same place, because of the unpredictable nature of it…but we’ll do some additional research and also announce such on our end before proceeding.

Apologies that we don’t have a surefire answer to your issue. Teleport is complex and we’re trying our best to make improvements as we can.

5 Likes

Understandable, thank you for thinking about the philosophy in detail!

For my use case here, this is a story game so an in-game “reset” mechanism likely won’t work (however a reset teleport feature totally would). Instead, I’ll remove the restart button and keep the lobby button - from the lobby they can join the same chapter they were just in. It’s a bit of friction for the user, but it’ll do.

Worst case scenario if that proves to be too friction-filled, I’ll reserve a server and warn the user that the reset button will put them into a server alone.

3 Likes

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