Keltrin
|
  |
| Joined: 01 Jan 2014 |
| Total Posts: 2085 |
|
|
| 17 Jul 2015 04:32 PM |
local st = enemyTorso.Position local path = pathFind:ComputeRawPathAsync(st, playerTorso.Position, 80) if path.Status == Enum.PathStatus.FailStartNotEmpty or path.Status == Enum.PathStatus.FailFinishNotEmpty then print("failure") return end local points = path:GetPointCoordinates() for _, point in pairs(points) do hm:MoveTo(point) end Why does doing this make then enemy move in the same fashion that it would if I just told the enemy to move to the player's position without the pathfinding? |
|
|
| Report Abuse |
|
|
Keltrin
|
  |
| Joined: 01 Jan 2014 |
| Total Posts: 2085 |
|
|
| 17 Jul 2015 04:33 PM |
| BTW this is just a chunk of the code that tells the script to pathfind its wau to the playerTorso, I didnt want to post the full script because it's 30+ lines and wouldn't look as inviting |
|
|
| Report Abuse |
|
|
Trioxide
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 32902 |
|
|
| 17 Jul 2015 04:34 PM |
for _, point in pairs(points) do hm:MoveTo(point) end
Wait until enemy reaches the point, then go to the next ect |
|
|
| Report Abuse |
|
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 17 Jul 2015 04:41 PM |
for i, v in pairs(coords) do hm:MoveTo(v) hm.MoveToFinished:wait() end |
|
|
| Report Abuse |
|
|
Keltrin
|
  |
| Joined: 01 Jan 2014 |
| Total Posts: 2085 |
|
| |
|