You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the ...Canvas() line code will cause pheser can't change gameobject property on event.
like
this.thum = this.add.sprite(400, 300, 'dog');
this.thum.setInteractive({ draggable: true });
```
this.thum.on('drag', (pointer, dragX, dragY) => {
this.boy.x += dragX * 0.01;
this.boy.y += dragY * 0.01;
console.log(this.boy);
console.log("drag this.boy.x:" + this.boy.name + " : " + this.boy.x);
// event can trigger , this.boy.x will change , but this.boy object will cann't move,
// if remove the ...Canvas() from game.ts file, this.boy object will can move,
});
event can trigger , this.boy.x will change , but this.boy object will cann't move,
if remove the ...Canvas() from game.ts file, this.boy object will can move。
How to do?
The text was updated successfully, but these errors were encountered:
in the game.ts file
The text was updated successfully, but these errors were encountered: