Jump to content

debug body green square disappears in some parts on the screen


Mike018
 Share

Recommended Posts

I've made a simple sprite and enabled arcade physics, but for some reason, when I debug the body of the sprite, the green square only displays on the top left of the screen. When I drag it around anywhere else, the green square disappears, yet collisions still register. Any ideas why this is happening?

create() {

    this.pet2 = this.game.add.sprite(
      this.game.world.centerX,
      this.game.world.centerY,
      'atlas1',
      'pet2'
    );
    this.game.physics.enable(this.pet2, Phaser.Physics.ARCADE);
    this.pet2.inputEnabled = true;
    this.pet2.input.enableDrag();
}




render() {
    this.game.debug.body(this.pet2);
  }

 

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...