Teleporting the Player causes them to Die

For some reason when I teleport Players HumanoidRootPart CFrame to a selected CFrame position it causes the player to die if they were teleported whilst jumping/in the air. I originally thought this was happening because of a Fall Damage script I have however I tried disabling that script and it didn’t fix anything.

Here is the code I use to teleport:

for i, Player in pairs(game.Players:GetPlayers()) do
				local Character = Player.Character

				if Character then
					local chosenSpawnPoint = PlayAreaSpawns[math.random(1, #PlayAreaSpawns)]
					local HumanoidRootPart = Character.HumanoidRootPart
					HumanoidRootPart.CFrame = chosenSpawnPoint.CFrame
				end
			end

Could somebody please help me fix this?

Try

Character:SetPrimaryPartCFrame(chosenSpawnPoint.CFrame)
1 Like

https://developer.roblox.com/en-us/api-reference/property/Workspace/FallenPartsDestroyHeight

Make sure you’re not teleporting them below the height at which parts are destroyed.

2 Likes

It may be that this breaks the neck attachment which would also kill a character. Instead of

HumanoidRootPart.CFrame = …

you could try

Character:SetPrimaryPartCFrame(…)