Character is teleported after spawning

I set the CFrame of the Torso when the character is added, but then it’s teleported somewhere else. There are no SpawnLocations in the game, it just teleports to the default drop location.

repro:

function addplayer(player)
	local function addcharacter(character)
		local torso=character:WaitForChild("Torso")
		torso.CFrame=CFrame.new()
		print(player,torso.CFrame)
		wait()
		print(player,torso.CFrame)
	end
	addcharacter(player.Character or player.CharacterAdded:wait())
	player.CharacterAdded:connect(addcharacter)
end
for _,v in pairs(game.Players:GetPlayers())do addplayer(v)end
game.Players.PlayerAdded:connect(addplayer)

tries to teleport the character to CFrame.new() but it ends up at around 0,103,0

Whatever it is that is automatically teleporting the charcater should be doing it before firing CharacterAdded.

2 Likes

In my skydiving simulator I move the character when their user selects a spawn point. It was moving them to somewhere off of where I tried to teleport them.

In my case, the character had existed for a few seconds minimum before I attempted to teleport them. Not sure what causes this but it should be looked in to because something is messing with it.

I agree that it should move the character to where it’s supposed to spawn before CharacterAdded and I also suggest that there be a way to disable automatic spawn positioning entirely. When I was creating a custom spawn system, I had to fight with ROBLOX spawning. There was no way around it. If I wanted to create a character, I had to use LoadCharacter, and LoadCharacter initiated the spawning. We can kind of use GetCharacterApperanceAsync to create characters without LoadCharacter now, but that method is subject to throttling, and I’ve run into issues where 1) the appearance didn’t load at all and 2) the apperance loaded a lot slower than it did when I used LoadCharacter. It’s not fit for being invoked every time a player spawns.