Setting Player.RespawnLocation and then calling Player:LoadCharacter() does not respect the RespawnLocation set

Setting Player.RespawnLocation and then calling Player:LoadCharacter() does not respect the RespawnLocation set.

This is bad because then I have to manually teleport the player to the given spawn location, searching for a location to spawn, instead of letting Roblox handle it.

Repo steps.

  1. Open up a new place
  2. Add a new SpawnLocation
  3. Position SpawnLocation away from origin. This is the default location to load a character.
  4. Make the SpawnLocation disabled (so we don’t auto-spawn there)
  5. Disable auto player loading in Players
  6. Make a server script that does the following
local Players = game:GetService("Players")
local Workspace = game:GetService("Workspace")

wait(5) -- Let client load, this is a hack

for _, player in pairs(Players:GetPlayers()) do
    player.RespawnLocation = Workspace.SpawnLocation
    player:LoadCharacter()
end

Expected result: Player’s character loads at the given location
Actual result: Player’s character does not load at the spawn location, instead loads at origin.

Minor note: I’m suffering from another bug which prevents me from logging into Roblox studio. I haven’t been able to test these specific repo steps. If they do not work, post here and I’ll update the instructions.

11 Likes

This thread doesn’t appear to have been solved. @Kampfkarren did you ever solve your issue?

Player.RespawnLocation woes?

Reading the thread, doesn’t seem like it; I just ended up setting .Enabled. You may be able to set the spawn to Enabled, LoadCharacter, and flick it off?

I actually already do that.

I’m fairly certain this is a replication issue.

  • RespawnLocation appears to work in play solo (IIRC)
  • Enabled is definitely true on some of the SpawnLocations I’m using, although it’s immediately turned off
    • This might cause Enabled to replicate, and then the LoadCharacter() request to replicate.
1 Like

Being a replication issue makes sense, a lot of character stuff is client side and I’m certain RespawnLocation needs to be Enabled for LoadCharacter to use it.

I don’t remember this happening to me, but it was a long time ago since I had my issue.

I’m going to write a feature request to suggest that Player.RespawnLocation be the end-all be-all where the player should spawn.

EDIT: Done.