|
| 21 Jan 2017 05:40 PM |
local enemy = getnearestenemy() if enemy then local compute = pathfinding:ComputeSmoothPathAsync(script.Parent.Parent.Torso.Position,enemy.Torso.Position,512) local point = compute:GetPointCoordinates() print(#point) if #point > 2 then script.Parent:MoveTo(point[3]) elseif #point > 1 then script.Parent:MoveTo(point[2]) end end I was wondering why my npc isnt moving to me even though im at a fair distance, so i added prints to see why; turns out the length of the table returned from getpointcoordinates is 1. The variable "enemy" is just the closest enemy, and pathfinding is well.. pathfinding.
This siggy is copyrighted © |
|
|
| Report Abuse |
|
|
|
| 21 Jan 2017 06:33 PM |
does seriously no one know to to fix this wtf
ive been asking this since yesterday
This siggy is copyrighted © |
|
|
| Report Abuse |
|
|
|
| 21 Jan 2017 06:44 PM |
| "if #point > 2 then script.Parent:MoveTo(point[3]) elseif #point > 1 then script.Parent:MoveTo(point[2]) end" Whats with this? Use a for loop to move. Also make sure the ############# ## the humanoid for _, each in ipairs(point) do script.Parent:MoveTo(point) end Also make sure that you check the humanoid has reached the next point before calling MoveTo again. |
|
|
| Report Abuse |
|
|
|
| 21 Jan 2017 06:46 PM |
"if #point > 2 then script.Parent:MoveTo(point[3]) elseif #point > 1 then script.Parent:MoveTo(point[2]) end"
Whats with this?
Use a for loop to move. Also make sure the Parent is the humanoid
for _, each in ipairs(point) do script.Parent:MoveTo(point) end
Also make sure that you check the humanoid has reached the next point before calling MoveTo again. |
|
|
| Report Abuse |
|
|
|
| 21 Jan 2017 09:38 PM |
the problem is that the status is closest no path and i have no idea how to solve that
i'll worry about the moving part later when the status is actually successful
This siggy is copyrighted © |
|
|
| Report Abuse |
|
|
|
| 21 Jan 2017 09:56 PM |
just noticed the problem. seems like the floor has to be at LEAST 8 studs thick even if you set the emptycutoff to 0. So stupid.
This siggy is copyrighted © |
|
|
| Report Abuse |
|
|
|
| 21 Jan 2017 10:05 PM |
i set the emptycutoff to 0 and the thickness of the floor to 20, but still closestnopath.... did roblox break pathfinding or something
This siggy is copyrighted © |
|
|
| Report Abuse |
|
|