am experimenting with timeLine
Exist a way to add a simple instance with callback but without target ?
const actiontl = new TimelineLite();
actiontl.to(items, 0.2, {x:'+=140',y:'-=140', ease: Power4.easeOut },'#step1')
.to(items.map(i => i.scale), 0.3, {x:0.8,y:0.8, ease: Elastic.easeOut.config(1, 0.3) },'#step1')
.to(items, 0.1, {x:target.p.x ,y:target.p.y-(target.p.height/2), ease: Back.easeIn.config(1) } )
.to(null, 0, { onStart: () => { target.s.state.setAnimation(1, "hit1", false) } } ) //FIXME NO WORK !
.from(items.map(i => i.scale), 0.3, {x:2,y:2, ease: Power4.easeOut } ,'#hit')
.from(items, 0.3, {rotation:4, ease: Power4.easeOut } ,'#hit')
.to(items, 1, {x:'-=100' ,y:'-=150', ease: Expo.easeOut },'#hit' )
.to(items, 0.6, {x:'-=15' ,y:target.p.y, ease: Bounce.easeOut } )
So example here : .to(null, 0, { onStart: () => { target.s.state.setAnimation(1, "hit1", false) } } )
i found more readable to split my event from animation, but i get
"Cannot tween a null target.";
So if i understand we can no work like this , i need to add the event callback onStart in a valide timeline with target ?
Or existe a way to use a empty timeline with only a event ?
thanks