I am doing something similar to the "Navigation Polygon (2D)" example, except have more than one item to move along the path. As a result, I didn't want to repeat the same while loop in _process twice and so wanted a separate function. All attempts wouldn't work. One example is below:
func _process(delta):
if (path.size() > 1):
while(to_walk > 0 and path.size() >= 2):
some_function()
I also tried a simple test with the while loop only in "some_function()" as well:
func _process(delta):
if (path.size() > 1):
some_function()
func some_function():
while 1<2:
print ("a never ending while")
Is there a way of doing this or a reason this can't be done?