Super easy scripting problem. One simple script that spawns the player at certain location (0, 30, 46) rather than using a spawn location.
game.Players.PlayerAdded:Connect(function(Player) -- Player being added
Player.CharacterAdded:Connect(function(Character) -- Character being added
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart") -- Awaits the humanoidrootpart to spawn instead of LowerTorso or Torso to avoid more lines of code.
local Part_Spawn = game.Workspace:FindFirstChild("PartNameHere") -- Search for the part to spawn at.
wait(1) -- Delay till we are sure of it.
HumanoidRootPart.CFrame = Part_Spawn.CFrame -- Uses CFrame to get the Direction & the position.
end)
end)
game:GetService("Players").PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
game:GetService("RunService").Heartbeat:Wait() -- requires this for some weird spawn mechanic reason
Character:PivotTo(CFrame.new(0,30,46)) -- This could be any CFrame
end)
end)
I wouldn’t recommend using HumanoidRootPart.CFrame, since it only moves that part (which works most of the time, but breaks things like ragdoll systems if they’re active) and allows you to move the character in the case that the HumanoidRootPart doesn’t exist (yet)
Also, due to some mechanic weirdness, you have to wait a Heartbeat step before teleporting.
I actually didn’t know anyway around this
Amazing work, thanks for also teaching me a new mechanic / way to spawn players.
Hope he finds the solution on yours!
Wow. A solution competition. I’ll test them both.
It’s basically the same as yours with the wait(1), but since it fires after a physics calculation step (RunService.Stepped runs before a physics step, RunService.Stepped runs after), it works properly. It probably has something to do with how it moves the character to the SpawnLocation, so you have to wait for a step to pass.
I suggest taking @Inconcludable he has the best way to spawn a player to a CFrame pos.
Yeah, although if I didn’t know this by then who knows what I would’ve done in the near future with trying to spawn players in random locations lol.