Coroutine not continuing

Hi, I have the following snippet of code:

local navigator = createNavigator()
coroutine.wrap(navigator:Wander())

print("continue")
task.wait(5)
navigator.targetPosition = Vector3.new(5, 5, 5)

You’d expect it to print “continue”, however after looking in Logs I see nothing.
Does anyone know why this might be the case?

I also tried using task.spawn and having no task/coroutine, but nothing works. When setting targetPosition in other places it seems to work as intended, as well.

Have you tried this? (Assuming that navigator:Wander() doesn’t return a function)

local navigator = createNavigator()
coroutine.wrap(navigator.Wander)(navigator)

print("continue")
task.wait(5)
navigator.targetPosition = Vector3.new(5, 5, 5)
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.