#Async Spawn + Path Finding

2 messages · Page 1 of 1 (latest)

tropic aspen
#

If I understand this correctly its a race condition somewhere but I dont quite understand why if the path finding is async and we wait for each waypoint to complete.

tropic aspen
#

So I know I can resolve the spawning by adding a 3 second delay like so:

-- move through map async
coroutine.wrap(mob.Move)(newMob, map)
task.wait(3)

While this now delays the spawning only the first mob will move. Any mobs spawned only stand there.

I think this is because the pathing for each mob must complete before it moves.

I think Ill have to use multiple threads for each mob:
thread1: for each path computing
thread2: for each mob that walks on the path