generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Pathfinding problems.

Previous Thread :: Next Thread 
bojigglesmister2 is not online. bojigglesmister2
Joined: 26 Jun 2011
Total Posts: 1421
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
bojigglesmister2 is not online. bojigglesmister2
Joined: 26 Jun 2011
Total Posts: 1421
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 is not online. 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
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
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
bojigglesmister2 is not online. bojigglesmister2
Joined: 26 Jun 2011
Total Posts: 1421
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
memorycode is not online. memorycode
Joined: 24 Sep 2011
Total Posts: 3322
27 Feb 2015 05:07 PM

that's the point of his script

those four years of wumbology are really paying off
Report Abuse
bojigglesmister2 is not online. bojigglesmister2
Joined: 26 Jun 2011
Total Posts: 1421
27 Feb 2015 05:09 PM
And its not working.
Report Abuse
memorycode is not online. memorycode
Joined: 24 Sep 2011
Total Posts: 3322
27 Feb 2015 05:11 PM

output?



those four years of wumbology are really paying off
Report Abuse
bojigglesmister2 is not online. bojigglesmister2
Joined: 26 Jun 2011
Total Posts: 1421
27 Feb 2015 05:14 PM
No output. It moves once, then stops.
Report Abuse
bojigglesmister2 is not online. bojigglesmister2
Joined: 26 Jun 2011
Total Posts: 1421
27 Feb 2015 05:20 PM
BUMP
Report Abuse
bojigglesmister2 is not online. bojigglesmister2
Joined: 26 Jun 2011
Total Posts: 1421
27 Feb 2015 05:35 PM
BUMP again
Report Abuse
bojigglesmister2 is not online. bojigglesmister2
Joined: 26 Jun 2011
Total Posts: 1421
27 Feb 2015 05:50 PM
Bump please help someone
Report Abuse
bojigglesmister2 is not online. bojigglesmister2
Joined: 26 Jun 2011
Total Posts: 1421
27 Feb 2015 06:00 PM
Bump
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image