-
What do you want to achieve? I want my npc to jump over blocks
-
What is the issue?
In studio it works fine but when I go in game it does not jump at all
local PathfindingService = game:GetService("PathfindingService")
local human = script.Parent:WaitForChild("Humanoid")
local torso = script.Parent:WaitForChild("Torso")
local path = PathfindingService:CreatePath()
path:ComputeAsync(torso.Position, script.Parent.Parent.Body.Seat2.Position)
local waypoints = path:GetWaypoints()
for i, waypoint in pairs (waypoints) do
if waypoint.Action == Enum.PathWaypointAction.Jump then
human:ChangeState(Enum.HumanoidStateType.Jumping)
end
human:MoveTo(waypoint.Position)
human.MoveToFinished:Wait(2)
end
Did I do something wrong with my code did I miss anything
Any help would be nice thanks!