I'm trying to get an NPC to move to a random block inside a model. Here's the code:
local base = game.Workspace.Base target = base:FindFirstChild("building") script.Parent.Humanoid:MoveTo(Vector3.new(target.Position))
The NPC, instead of moving to one of the blocks, moves to the center of the baseplate instead. Any Idea why?
You're calling Vector3.new
on an object that is already a Vector3. Doing this resets it to 0,0,0
.
script.Parent.Humanoid:MoveTo(target.Position)