hi everyone
i wanna to define one function and user that in collider for player and one platform
but when i use animation in my local function, i see below error
PlayScene.js:205 Uncaught TypeError: Cannot read properties of undefined (reading ‘play’)
this.door = this.physics.add.image(1400, 230, "door");
this.door.setImmovable(true);
this.door.body.setAllowGravity(false);
this.anims.create({
key: "openDoor",
frames: this.anims.generateFrameNumbers("door", { start: 0, end: 6 }),
frameRate: 7,
repeat: 0,
});
this.physics.add.collider(
this.o.player,
this.platform2,
doorFunc,
null,
this
);
function doorFunc() {
console.log("door test", this.door);
this.door.anims.play("openDoor", true);
}