#My pathfinding is laggy..?

1 messages · Page 1 of 1 (latest)

tribal carbon
#

like every step has a little delay and its weird aa

hard apex
#

Maybe because u say char.humanoid:movetofinished:wait()

celest bane
#

i feel like this is written way too complicated

celest bane
spare raft
spare raft
# tribal carbon

i have had the same issue before, or relatively the same issue, so i recommend maybe keeping the character moving WHILE processing a new path because the process is probably holding up the time until he moves again creating that.

slender folioBOT
#

studio** You are now Level 2! **studio

tribal carbon
#

i'll try that later

spare raft
#

Prbably

tribal carbon
#

ok i updated the Step function to Updatepath before waiting for the character to finish walking and the problem still persists, anyone got any ideas on why?

tribal carbon
#

ok i just outright removed the MoveToFinished and it seems to work (along with other changed like replacing while loop with Stepped purely just because i dont like while true do loops)

#

ok now im testing out different speeds

#

but if i set it too fast there are like pauses (because the waypoints are simply too close to eachother)

#

wondering if theres a way to chang ethat?

graceful verge
#

you can try calculating the distance between waypoints and the amoun t of time it would take to traverse them using humanoid's walkspeed

#

then using that to wait

tribal carbon
#

uhh i should update the ss actually

graceful verge
#

u are updating the path every stepped?

#

that will cause lag and stutter

#

what u want to do is

#

save the target position of the path right

#

then check if the target position of the path and the distance between the target is over a certain amount

#

if so then recalculate the path

#

else continue on the path

tribal carbon
#

so only recalculate path when the target moves?

tribal carbon
graceful verge
tribal carbon
#

oh boy alright then