I'm working on a game. Inside of it, i have an array which gets loop through using a for loop and if each object is not being tweened, it tweens them to a specific position like this:
if(ship.active_bullets.length > 0){
for(var i = 0; i < ship.active_bullets.length; i++){
if(ship.active_bullets[i]){
if(TweenMax.isTweening(ship.active_bullets[i])===false){
TweenMax.to(ship.active_bullets[i], 2*scale, {y:0,ease:Power0.easeNone,onComplete:function(){
console.log(i)
}});
}
}
}
}
The output in the console on complete is then number 1 instead of 0 which is what it is before the tween. why is this?