Jump to content

Phaser P2 Physics Pause


elleniaw
 Share

Recommended Posts

What is the recommended way of temporarily disabling physics for sprites?

I have an object pool that non active sprites are stored in and I want to make sure the physics don't run at all when sprites are in the pool.

 

At this moment I have:

this.body.data.gravityScale = 0;this.body.data.shapes[0].sensor = true;this.currentState = this.BUBBLESTATE.DEAD;

And I disable the Sprites Update function on BUBBLESTATE.DEAD

If I look at the debugger I see a high ms on update -> physics when I have a lot of sprites active and pooled.

So my assumption is that even the pooled sprites are still running physics.

 

Some way to force them sleep and wake up would be perfect because I have control over when they should go to sleep and wake up.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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