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

Unable to cast value to object???


	print("Armytruck touched this")
	while true do
		local player = game.Workspace.NPC
	player.Humanoid:MoveTo(Vector3.new(0,0,0),game.Workspace.End.Position)
	
	wait()
	end 

	
	

The error from Roblox Studio: Unable to cast value to object

Why do i get this error. What does it mean?

2 comments

0

do you know what line it says it on?

0

This Line: player.Humanoid:MoveTo(Vector3.new(0,0,0),game.Workspace.End.Position)

1 answer

✓ Accepted answer

moveTo() only works for models and you're trying to move a players humanoid... Another thing you're doing wrong is adding another vector3... You should only be giving it one vector3 value. Here.

player.Character:MoveTo(game.Workspace.End.Position)

1 comment

0

I have read on the wiki that MoveTo also works on a humanoid. It worked, though

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