I'm trying to pass an object through a callback function onUpdateTween( groups[i], this );
but it doesn't give me the correct object. It only gives me the last object from the groups array. How can I solve this?
function transform( duration ) {
for ( var i = 0; i < groups.length ; i ++ ) {
new TWEEN.Tween(object.rotation)
.to( rot , duration )
.easing( TWEEN.Easing.Exponential.InOut )
.onUpdate( function() {
onUpdateTween( groups[i], this );
})
.start();
}
}