So, I’ve copied my character’s animation script and paste it into my character model which I’ve imported. Then, I coded my pathfinding service script inside the model but it didn’t work. But when I tried to use the pathfinding script on a random NPC I got from thee toolbox, it worked.
Help me solve this problem, thank you!
Pathfinding script:
local pathfinding = game:GetService("PathfindingService")
local hum = script.Parent.Humanoid
local root = script.Parent.HumanoidRootPart
local goal = game.Workspace.Part
local createPath = pathfinding:CreatePath()
createPath:ComputeAsync(root.Position,goal.Position)
local waypoints = createPath:GetWaypoints()
for i,v in ipairs(waypoints) do
if v.Action == Enum.PathWaypointAction.Jump then
hum.Jump = true
end
hum:MoveTo(v.Position)
hum.MoveToFinished:Wait(1)
end
Picture of my character model.
