I have a div that I need to continuously move downwards in a loop. When using Tween with repeat -1, the movement starts from where it began which is not what I desire.
var tlMain = new TimelineMax({repeat:0});
tlMain.to(group.position, 2 , {y: '-=10', ease: Power0.easeNone, repeat:-1});
Currently, the timeline behaves as follows:
Start: 10
1st : 10
2nd : 10
With every iteration, the position changes accordingly:
Start: 10
1st : 0
2nd : -10
3rd : -20
Is there a way to achieve this looping behavior with Tween or should I implement it in a more primitive way like in my render method?
function render(...args) {
group.position.y -= 10;
requestAnimationFrame(render(...args))
}
Alternatively, should I use a for loop to create an infinite animation instead of relying on repeat? (which does work)