Hi, I'm fairly nee to AGS. I have a character that moves, and when she's done moving I want a GUI to appear. Here's the code:
gText2.Visible = false;
cClient1.SetWalkSpeed(6, 6);
cClient1.Move(500, 720, eNoBlock, eAnywhere);
if (cClient1.Moving == false) {
gText2.Visible = true;
}
I'm trying to check if the character stopped moving in the if-statement, but it's not working. The character does move but nothing happens when she stops. I tested it with another character that doesn't move at all, and the GUI does show up. What am I doing wrong?
Try this instead:
while (cClient1.Moving) {
Wait(1);
}
gText2.Visible = true;
This will keep looping until Moving becomes false.
Wait(1) is necessary to let engine update and redraw the game (otherwise it will stuck in script forever).
Thanks, it worked!
If blocking the game is fine, you can simply use eBlock instead, I guess?