elleniaw Posted December 7, 2015 Share Posted December 7, 2015 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.DEADIf 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 More sharing options...
drhayes Posted December 8, 2015 Share Posted December 8, 2015 You can set "sprite.body.enabled = false;" while you want there to be no collisions or overlaps. Link to comment Share on other sites More sharing options...
Recommended Posts