Jump to content

Uncaught TypeError: Cannot read property 'frame' of undefined


P@M@K
 Share

Recommended Posts

I am trying to load a sprite sheet into the game and animate, but I keep getting the Error: "Uncaught TypeError: Cannot read property 'frame' of undefined". 

        this.anims.create({
        key: "animate"+faculty[f],
        frames: this.anims.generateFrameNumbers("animal" , {starts:0ends:5}),
        frameRate: 10,
        repeat: -1})

I see that it has something to do with the "frames" key. 

Looked up online but the only thing I can find is someone who accidently put the "this.anims.create()" in his preload function instead of the create function. 

That is not my issue. 

Please some HELP! (been stuck on this for hours)

this is the preload for the spritesheet: (it has a total of 5 frames. dimensions: height= 16, width=80)

this.load.spritesheet("animal""animal_image.png", { frameWidth: 16frameHeight: 16 }); 
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...