Kyatric, I changed the capx and added comments. I replaced the outer loop with a simple condition, to make it less confusing. The capx represents this (in pseudocode):
System->onEveryTick{
int VariableInWrongScope = 0;
foreach (TestObject in TestObjectList) {
VariableInWrongScope = TestObject.MyInstanceVariable;
if (VariableInWrongScope == 0) {
TestObject.setInvisible();
}
}
// is correct, but I don't want it accessible here
if(VariableInWrongScope == 0) {}
}
What it should look like (but seems not possible) is this:
System->onEveryTick{
foreach (TestObject in TestObjectList) {
int VariableInCorrectScope = 0;
VariableInCorrectScope = TestObject.MyInstanceVariable;
if (VariableInCorrectScope == 0) {
TestObject.setInvisible();
}
}
// this won't work (this is what I want)
if(VariableInCorrectScope == 0) {}
}
Maybe I misunderstand the structure of events and actions. It's also not critical (I can live with the broader scope)