Jump to content

Atlas sprite body error


Recommended Posts


I am trying to replace a standard sprite sheet in my game with a json atlas, but I am getting error when I try to access the body element of the sprite. I couldn't find anything in the examples or on the forum about this.  The sprite works fine with a plain png spritesheet.


function preload() {

game.load.atlas( 'atlas', 'assets/player.png', 'assets/player.json' );



function create() {

player = game.add.sprite(32, 32, 'atlas');

player.body.collideWorldBounds = true; //error here




Link to comment
Share on other sites


  • Recently Browsing   0 members

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