Tween timeline with different targets

I’m trying to figure out how to turn off visibility in the first target after it has finished. As a workaround I’m using sprite1.visible = false; in the Update function when the x coordinate has been reached. Seems like there should be a better way to do this.

	var timeline = this.tweens.createTimeline();

timeline.add({
    targets: sprite1,
x: 100,
duration: 4000,	
onComplete:()=>sprite2.anims.play('sprite2'),	    
    ease: 'Linear'
});

//sprite1.visible = false;

timeline.add({
    targets: sprite2,
y: 100,
duration: 4000
onStart:()=>sprite2.visible = true,	    
    ease: 'Linear'
});    

 timeline.play();

Sorry. I forgot I was using a timeline. I can turn off visibility in the first timeline. No need to use that play command.

Hello, I guess you can do…