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

287
Views
Uncaught TypeError: Cannot read properties of undefined (reading 'frame')

I'm currently trying to animate a few frames from a spritesheet using Phaser3. The page successfully renders the first frame of the animation to the screen, but fails when I try to actually code in any of the animations.

Here's what I have so far:

export default class Intro_Animation extends Phaser.Scene
{
  constructor()
  {
    super('Intro_Animation');
  }

  intro(){}

  preload()
  {
    this.load.path = './src/assets/intro/';

    this.load.spritesheet('intro_frame', 'westwardJourney_02-Sheet.png',
  {frameWidth: 144, frameHeight: 130});
  }

  create()
  {
    //fails somewhere in the animations here
    var introAnim_config = {
        key: 'introWalkAnim',
        frames: this.anims.generateFrameNumbers('intro_walk', { start: 0, end: 23, first: 23 }),
        frameRate: 20,
        repeat: -1
    };

    this.anims.create(introAnim_config);

    //loads in first frame here
    this.add.sprite(250, 150, 'intro_frame').play('introWalkAnim');
  }
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I just can assume, without knowing the exact error message, that the frameWidth and/or frameHeight is maybe too big (meaning: bigger than the actual image size, even for 1px is enough). This could produce an error like:

Uncaught TypeError: Cannot read properties of undefined (reading 'duration') ...

and also show an image.

Except this, I don't know any other reason, how an error could occur, while displaying atleast a part of an image, and I tested serveral possibilities and combinations.

about 4 years ago · Juan Pablo Isaza Report
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!