I tried to make my code into a function and got this error.
Cannot read properties of undefined (reading ‘add’).
const fingerMovement = () => {
if (playComputer) {
Finger.visible = true;
this.tweens.add({
targets: Finger,
x: 50,
y: 600,
duration: 1000,
onComplete: () => {
diceButton1.emit('pointerdown');
}
});
}
};