Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

[SOLVED] Why function isn't working?

Game can’t see the “var soldier = soldiers[i]” from this function;

Hi Phoenix.
You can’t access variables from functions in your while true loop. You have to redefine soldier.
:lion: :lion: :lion:

1 Like

Yeah, i move them inside the while-true and it works. Thank you.

1 Like