Humanoid:MoveTo seems to not work with slow speed NPCs?
Asked by
3 years ago Edited 3 years ago
So i have a script that makes an NPC walk to certain waypoints then destroy itself, here's the script:
02 | local Waypoints = game.Workspace.Map.Waypoints |
03 | local Way 1 = Waypoints:WaitForChild( 'Waypoint1' ) |
04 | local Way 2 = Waypoints:WaitForChild( 'Waypoint2' ) |
05 | local Way 3 = Waypoints:WaitForChild( 'Waypoint3' ) |
06 | local Way 4 = Waypoints:WaitForChild( 'Waypoint4' ) |
07 | local Way 5 = Waypoints:WaitForChild( 'Waypoint5' ) |
08 | local Way 6 = Waypoints:WaitForChild( 'Waypoint6' ) |
11 | local Self = script.Parent.Parent |
12 | local hum = Self:WaitForChild( 'Humanoid' ) |
13 | local Walk = hum:LoadAnimation(Self:WaitForChild( 'Walk' )) |
16 | local function MoveHumanoid(humanoid, waypoint) |
17 | humanoid:MoveTo(waypoint.Position) |
18 | humanoid.MoveToFinished:Wait() |
23 | MoveHumanoid(hum, Way 1 ) |
24 | MoveHumanoid(hum, Way 2 ) |
25 | MoveHumanoid(hum, Way 3 ) |
26 | MoveHumanoid(hum, Way 4 ) |
27 | MoveHumanoid(hum, Way 5 ) |
28 | MoveHumanoid(hum, Way 6 ) |
I use this script in many different NPCs (a fast walking one and a normal speed one) and it works fine until I put this script in a slow walk speed NPC. It moves to the first couple waypoints semi-fine but when it reaches the 3rd waypoint it goes half way and skips straight to the 5th. Any help is appreciated thanks!