Jump to content

P2 body debug graphics at coord 0, 0


Recommended Posts

As the title states, whenever I debug my p2 bodies using the suggested "body.debug = true" method, they show up with the correct size, but are rendered at coordinates 0, 0. I can confirm that the actual physics body is at the correct position, only the debug graphics is at the wrong place.


I am using Phaser version 2.2.1, the bodies are static and have "sensor" set to true.


If you need more information, please ask.


EDIT: I have managed to make an ugly fix for this using:

if(developerSettings.debug) {        this.body.debug = true;        this.body.debugBody.x = this.body.x;        this.body.debugBody.y = this.body.y;    }

This is of cause not pretty, will only render the initial position of the body, and should be unnecessary. It seems like the debugBody position is not being set correctly in the core.

Link to comment
Share on other sites


  • Recently Browsing   0 members

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