Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why does the character not move using humanoid:MoveTo()?

This code in workspace does not move the character. Any solution

script.Parent.cutedoge7575.Humanoid:MoveTo(game.Workspace.asdfasdfasdfhesgt.Position)

2 comments

0

Is "asdfasdfasdfhesgt" an existing part?

0

Yes

1 answer

It's probably because your code tries to move a player before they join. You will need to make a function to wait until the character is loaded. Try this code:

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		character.Humanoid:MoveTo(game.Workspace.asdfasdfasdfhesgt.Position)
	end)
end)

1 comment

0

Make sure there is a while loop, since the position can change, and moveto isnt so great, it stops halfway.

This discussion is preserved as it was. New answers, comments, and votes are closed.