Phaser P2 physics gravity should be pulling straight down, but is pushing horizontally as well?

January 15, 2018, at 4:27 PM

I have been trying to establish a basic world with Phaser and the P2 physics system. However, following the basic tutorials and examples, my sprite gets pulled to the right as if there is horizontal gravity force applying to it. I have tried several things, including explicitly setting gravity.x to zero, but nothing seems to have fixed the issue.

The sprite itself's anchor is set to 0.5 and 1, in order to center it on horizontal. Here is a short clip of what's happening:

The code I've included so far for the system is this:

game.stage.disableVisibilityChange = true;
game.physics.p2.gravity.y = 80;
game.physics.p2.applyGravity = true;    

^ Physics settings, game, X, Y, 'ball');
this.body.damping = 0.5;
this.body.fixedRotation = true;
this.anchor.x = 0.5;
this.anchor.y = 1;

^ Sprite settings

There are no other forces beyond default acting on the rigidbody. What is going on here?

Javascript logical operation (a === true || a === false)

Javascript logical operation (a === true || a === false)

I found this piece of code inside momentjs

Have a Google Form set the title to the users email

Have a Google Form set the title to the users email

I'd like to make a Google Form that I can email to multiple people and when they open the form to fill it out, the title will be replaced with their email