mirror of
https://github.com/photonstorm/phaser
synced 2024-11-15 17:28:18 +00:00
Issue #1885: P2.enableBody now checks if an anchor exists on target object before attempting to set its value
This commit is contained in:
parent
8919e4e128
commit
a556dfdc69
1 changed files with 3 additions and 1 deletions
|
@ -337,7 +337,9 @@ Phaser.Physics.P2.prototype = {
|
|||
{
|
||||
object.body = new Phaser.Physics.P2.Body(this.game, object, object.x, object.y, 1);
|
||||
object.body.debug = debug;
|
||||
object.anchor.set(0.5);
|
||||
if (typeof object.anchor !== 'undefined') {
|
||||
object.anchor.set(0.5);
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue