Jump to content

P2 - can I globally disable physics, collisions for P2 sprite?


Recommended Posts


I just creating pinball game with Phaser... I'm using P2 physics.


I have one sprite BALL:

 this.ball = game.add.sprite(x, y, 'ball'); game.physics.p2.enable(this.ball, false); this.ball.body.setCircle(10); this.ball.body.fixedRotation = true;

But in one case I need to make this ball to ignore collisions with all elements... (ball should to pass through other sprites without collisions)

I just need to turn off gravity, collision and then randomly move ball to different place and then turn gravity/collisions ON. 

I'm trying to create ball movement in rails above other elements.



Link to comment
Share on other sites


  • Recently Browsing   0 members

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