Im trying to make an npc follow since hes the bad guy trying to "kill me". This is my code
local closesdistance = 100
while wait(1) do
if game.Lighting.TimeOfDay == "00:00:00" then
if (game.Players.LocalPlayer.Character.HumanoidRootPart.Position - game.Workspace.badguy.HumanoidRootPart.Position).Magnitude < closesdistance then
game.Workspace.badguy.Humanoid:MoveTo(game.Players.LocalPlayer.Character.HumanoidRootPart)
end
end
end
I keep getting an error that says: 16:41:55.862 - Unable to cast Instance to Vector3. What does this mean?

1 comment
i recommend just using path finding https://developer.roblox.com/en-us/articles/Pathfinding