Hi all…
I want to make a collision when there is “pointerdown” event… but the collision of the codes here will occur at the second click. I want to the collision occur from the first click of pointerdown, but I dont know how to.
here my codes
this.input.on('pointerdown', function (pointer) {
console.log('down');
this.tweens.add({
targets: this.sprite,
y: { value: 3000, duration: 1500}
});
// collision
this.physics.add.existing(this.sprite)
this.physics.add.existing(this.tower)
this.physics.add.existing(this.tower2)
this.col = this.physics.add.collider(this.tower, this.sprite, this.onCollideHandler, null, this)
this.col2 = this.physics.add.collider(this.tower2, this.sprite, this.onCollideHandler, null, this)
this.onCollideHandler = () => {
}
}, this);
Please help me, thank you 