Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

152
Views
Cannot read properties of undefined (reading 'texture')
preload() {
    // prelaoding atlas png and json and anim json
    this.load.atlas('character','./Assets/Sprites/character_atlas.png','./Assets/Sprites/character_atlas.json');
    this.load.animation('character_anims','./Assets/Sprites/character_anim.json');
}


create(){
    // assigning player object to a physic
    this.player = new Phaser.Physics.Matter.Sprite(this.matter.world,0,0,'character','male_1');
    // printing sprite onto screen
    this.add.existing(this.player);
    // assigning keyboard inputs to variables
    this.inputKeys = this.input.keyboard.addKeys({
        up: Phaser.Input.Keyboard.KeyCodes.UP,
        down: Phaser.Input.Keyboard.KeyCodes.DOWN,
        left: Phaser.Input.Keyboard.KeyCodes.LEFT,
        right: Phaser.Input.Keyboard.KeyCodes.RIGHT,
    })
    console.log(this.player);
}

update(){
    this.player.anims.play('walking_right')

Why is this.player.anims undefined? Doesn't this.load.animation create this.player.anims?

Inspector showing that anims has been initialized:

Inspector showing that anims has been initialized

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!