Help with returning arrays.

I’m not sure what I did, but all of a sudden it gives me this error:

Assets/Nav_Scripts/node_command.js(24,63): BCE0101: Return type ‘Array’ cannot be used on a generator. Did you mean ‘IEnumerator’? You can also use ‘System.Collections.IEnumerable’ or ‘object’.

I need this function to return an array, and it worked fine before, so what happened?

Sounds like you’re trying to return an array from a coroutine, which you can’t do. Coroutines can only return IEnumerator.

–Eric

To elaborate, what happened is probably that you added a ‘yield’ somewhere… If you still aren’t sure what’s wrong, post the actual code.