0
Answered

Trying to set iterator to variable on a list of gameobjects

francisco chong 5 months ago in Game Creator updated by Marti (Lead Developer) 5 months ago 5

I have a list variable with 6 gameobjects and I also have a local variable with an characterIndex number variable in it.
When i execute an action im adding +1 to that characterIndex and then i do "iterator to variable" on the list to select the next one and "Move[Current]" it works the first time and then it stops working, it adds 1 and then doesn't add more, please help

Unity version:
2019.3.9f1
Game Creator version:
1.1.6

Answer

+1
Answer

Please disregard, I found the issue.
I was setting the question to random in another action.
Sorry for the multiple posts.

Answered

Hi Francisco;

I'm not sure what the problem might be. Your Inspector seems to be correct. We tried something similar on our end and the iterator correctly increments. I'm attaching a screenshot so you can compare it with your project.

Hope this helps and let me know if you still don't find what's wrong.

Hi here is the issue:
The first time I run this, characterIndex would be -1.

When you add 1 as you see below it would become 0 to this point everything is fine.

Now when I select from a list using this variable (Fig.2) It selects the correct index.

But in (Fig.3) its selecting index 3 any insights on what this would happen?

Fig. 1

Fig.2
The answers list selects the correct one


Fig.3
Selects the wrong one.

+1
Answer

Please disregard, I found the issue.
I was setting the question to random in another action.
Sorry for the multiple posts.

No problem. I'm closing the thread :-)