As a Roblox developer, it is currently too hard to implement custom respawn logic that doesn’t override the player’s position when they start a local test through Play Here.
As far as I can tell, the best way to implement this behavior currently is to measure the player’s distance from the default spawn position on respawn, and only override their position if they’re far enough away.
If Roblox is able to address this issue, it would improve my development experience because I could implement custom respawn logic that respects Play Here without unreliable workarounds.
I was thinking of some additional method/property for RunService, but feature requests are supposed to focus on the problem rather than proposed solutions. RunService already offers a method to determine if the game was started with Run in Studio.
Maybe something like RunService:IsPlayHere() and you can skip your respawn logic if it’s true.
I’ve experienced this issue before in one of my old games with custom respawn logic. It would be nice if I could grab this value so I can change it to fit my debugging needs.
I suggested Roblox should do respawn logic through a callback. However, idk how you’d check if the game was started in Play Here mode
function Player.RespawningCharacter(cf: CFrame)
-- return the same or new position
-- for example, this places the player 5 studs
-- above where the server wants to put them
return cf + Vector3.new(0, 5, 0)
end
This callback would only control the spawn position of the Player, maybe having a SpawnLocation in the callback when applicable is a good idea as well, ie: (CFrame, SpawnLocation) -> (CFrame|SpawnLocation)??