I want to access loopindex of my current for loop from a JS script in the actions. My code looks like this and it's not working:
I tried to use a counter instead but it starts an infinite loop. Please help. Is there a way to get loopindex here?
Try declaring a variable with loopindex, and using that variable in your function.
Develop games in your browser. Powerful, performant & highly capable.
Expressions are not valid JavaScript code. Things like loopindex can't be used directly in JavaScript.
See the Integrating events with script example for how to pass values between events and JS code.