hi,
i’m want to make a tween on my enemy when a bullet collide with him, but i have an error with the tweens, ‘this’ is not good interpretated. How could i do to fix it ? thanks for your reply.
bullets = g.physics.add.group({
defaultKey: 'particles',
maxSize: 10
});
// in update
this.physics.add.collider(enemys,bullets,on_hit,null,this)
on_hit=(enemy,bullet)=>{
//this works
bullet.visible=false;
//this not works
this.tweens.add({
targets: enemy,
duration: 200,
ease: 'Linear',
scaleX : 2,
scaleY : 2,
yoyo: true,
onComplete:()=>{enemy.flag=false}
})
}