Hundreds of features to explore
Games made in Construct
Your questions answered
Trusted by schools and universities worldwide
Free education resources to use in the classroom
Students do not need accounts with us
What we believe
We are in this together
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
Hi,
I wonder how to perform an event at the end (last loopindex) of a for-loop?
Any help welcome :)
Develop games in your browser. Powerful, performant & highly capable.
for( 0.. endIndexHere)
.. loopystuff
.. if(loopIndex = endIndexHere)
... stuff for the final value
When creating a for loop you enter the end index, so you know the final loopIndex. Just check when it appears and do your thing. :)
Thanks, but how to access the "if" in c2? I can compare global variables for a condition, but I can see the loopindex only at an action.
Could you show me an example?
Thanks, but how to access the "if" in c2? I can compare global variables for a condition, but I can see the loopindex only at an action. Could you show me an example?
Add condition 'system'->'Compare two values', you can enter two whatever values you desire :)
of course, thats it.
Many thanks :)