I’ve been trying to follow a youtube tutorial and I’m trying to add a sprite into my scene but I’m coming across an error I haven’t been able to find out much about. The error message is…
phaser.js?d4ef:192479 Uncaught TypeError: this.resetCropObject is not a function
at Object.MatterSprite [as Sprite]
Searching for the error I came across one github issue, https://github.com/photonstorm/phaser/issues/5211, not sure if it’s related or not. I have tried pulling in the version from the master branch but the problem still persists.
My code is below.
import { Scene } from 'phaser'
import store from '../../store/index';
export default class MainScene extends Scene {
constructor () {
super({ key: 'MainScene' });
}
preload() {
this.load.atlas('player', '/assets/sprites/player.png', '/assets/sprites/player_atlas.json');
}
create () {
this.player = Phaser.Physics.Matter.Sprite(this.matter.world, 0, 0, 'player', 'idle_behind_1');
this.add.existing(this.player);
}
}