I got a problem and that is the fact that it only runs once. I personally think the variable doesn’t change outside of the for loop but no idea how to fix it.
You need to be using elseif (or better yet, else) in cases like this. Both of your if statements are running at the same time.
else is also cleaner to read because you can see that the two branches are paired together in meaning. It’s also more efficient because it’s not evaluating branches that will never run.
Oh, but it looks like you’re also changing activated
inside of the loop, so every other part will be affected differently. You might want to change activated outside of the loop.
And one more thing. Regardless of whether activated is true or not, you always set the transparency to 1? So what does this loop even do?
1 Like
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.