Don’t use HumanoidRootPart.CFrame use something like Character:MoveTo().
is not RootPart.CFrame same as Character:MoveTo()
edit: nvm MoveTo changes the position while CFrame both the position and rotation, so yeah moveTo would be btter to use if we are teleporting the character
Yes it is. But its gonna cause a lot of bugs later on. For example I used that in a game of mine and when i wanted to use body movers like .Velocity or BodyVelocity it just teleported the player into the void. While your script DOES work. You really should use character:MoveTo().
game.Players.PlayerAdded:Connect(function(player)
local character
character = workspace:WaitForChild(player.Name)
character:MoveTo(workspace.Part.Position)
player.CharacterAdded:Connect(function(character)
character:MoveTo(workspace.Part.Position)
end)
end)
Unfortunately I think you may have to use task.wait/wait before you teleport the player because of how loading a player’s character works.
This would’ve been resolved if this was made live
From what I’ve read, if you want 100% reliability without any loops or using wait methods - you’ll have to use the Player.RespawnLocation
property on Player’s - which can only use a SpawnLocation Part which is a bit weird.
That’s so unfortunate Thanks for the reply & deep diving into the forum for me! I’ll look into the RespawnLocation thing however, as my player should only need to spawn once in the entire time in the game & it’s at the very moment they join the game. I hope they plan on releasing the update sometime soon - it feels like it would solve quite a few of my issues!
Ended up using this method & for the way my game functions - it’s far more reliable and exactly what I wanted, so thanks for the help!
Little side-note for you;
The CharacterAppearanceLoaded
is very unreliable to use, as it can probably stop the entire script if used incorrectly, just use CharacterAdded
, as you’re only accessing the parts inside the character, not the “appearance”.
Sorry about that , but I just found out about that function. But thank you for telling me.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.