Hey Developers!
I am currently making a story game, it is a collabration with @EconomicCrash47.
I am attempting to move the NPC, but I am getting this error:
I have never seen it before, and I cannot understand what is happening.
Here is my script:
function MoveNpc(Location, NPCName)
local NPC = game.Workspace[NPCName]
NPC.Humanoid:MoveTo(Location.CFrame)
NPC.Humanoid.MoveToFinished:Wait()
end
MoveNpc('Teacher', NPCPoints.Point1)
The MoveTo method expects a Vector3 position, not a CFrame. So you want NPC.Humanoid:MoveTo(Location.Position) or NPC.Humanoid:MoveTo(Location.CFrame.Position) instead.
function MoveNpc(Location, NPCName)
local NPC = game.Workspace[NPCName]
NPC.Humanoid:MoveTo(Location.CFrame.p)
NPC.Humanoid.MoveToFinished:Wait()
end
MoveNpc('Teacher', NPCPoints.Point1)```