I'm trying to make the npc to move to the current place it is supposed to but it doesn't.
In the output it says,Unable to cast Vector3. the error is in line 5,any help?
local torso = script.Parent.Torso.Position
local base = game.Workspace.Base
local human = script.Parent.Humanoid
local path = game:GetService("PathfindingService"):FindPathAsync(torso,base)
local points = path:GetWayPoints()
for i,v in pairs(points) do
local p = Instance.new("Part",workspace)
p.Anchored = true
p.CanCollide = false
p.Size = Vector3.new("1,1,1")
p.CFrame = CFrame.new(v.Position)
end
if path.Status == Enum.PathStatus.Success then
for i,v in pairs(points) do
human:MoveTo(v.Position)
human.MoveToFinished:Wait()
end
end
This script is in the model of the npc.

3 comments
your first argument is a Vector3 and your second is a userdata. add
.Positionto the end of line 2but
:FindPathAsync()is deprecated in favor of:CreatePath()so u should look into that: https://developer.roblox.com/api-reference/function/PathfindingService/CreatePathThanks