|
| 27 Feb 2015 04:56 PM |
Need some help debugging. Follow me if your interested. Easier to explain in game.
http://www.roblox.com/AI-Pathfinding-Testing-place?id=221234509 |
|
|
| Report Abuse |
|
|
|
| 27 Feb 2015 05:02 PM |
The npc doesn't go around walls and stuff, it does halfway ish
function MoveWithPath(closestplayer) local path = pathservice:ComputeRawPathAsync(torso.Position, closestplayer.Character.Torso.Position, 300) local points = path:GetPointCoordinates() for _, point in pairs(points) do humanoid:MoveTo(point) wait(.1) end end
players = {} for _, v in pairs(game.Players:GetPlayers()) do if v then table.insert(players, v) end end
while wait() do MoveWithPath(players[math.random(1, #players)]) end
|
|
|
| Report Abuse |
|
|
robomax11
|
  |
| Joined: 07 Jul 2011 |
| Total Posts: 6828 |
|
|
| 27 Feb 2015 05:03 PM |
closetplayer = random player
billy mays here with special tv offer |
|
|
| Report Abuse |
|
|
|
| 27 Feb 2015 05:04 PM |
for _, point in pairs(points) do humanoid:MoveTo(point) wait(.1) end
should be
for _, point in pairs(points) do humanoid:MoveTo(point) local distance repeat wait() distance = (closestPlayer.Character.Torso.Position - torso.Position).magnitude until distance < 3 -- or 4 end |
|
|
| Report Abuse |
|
|
|
| 27 Feb 2015 05:06 PM |
Yes but if the player its following's position changes, i want it to follow the new location
If i do that will that still work?
|
|
|
| Report Abuse |
|
|
|
| 27 Feb 2015 05:07 PM |
that's the point of his script
those four years of wumbology are really paying off |
|
|
| Report Abuse |
|
|
| |
|
|
| 27 Feb 2015 05:11 PM |
output?
those four years of wumbology are really paying off |
|
|
| Report Abuse |
|
|
|
| 27 Feb 2015 05:14 PM |
| No output. It moves once, then stops. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|