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

[SOLVED] Why function isn't working?

#1

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

0 Likes

#2

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

1 Like

#3

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

1 Like