Sign in to follow this  
zetsubou

Objects might fall through despite of collision

Recommended Posts

Hi.

When game object reaches high speed on y axis it might fall through a ground layer(that supposed to be collided with).

Can I fix it somehow? Perhaps increase frequency of collision checking(Is it possible in Phaser?).

Share this post


Link to post
Share on other sites

If you use Matter:

You can adjust the number of iterations that Engine.update performs internally.
Use the Scene Matter Physics config object to set the following properties:

positionIterations (defaults to 6)
velocityIterations (defaults to 4)
constraintIterations (defaults to 2)

 

If you use Arcade you could just alter World.js a bit where it says (in update):

this.step(fixedDelta);
 

Share this post


Link to post
Share on other sites

So, I came up with a solution that works(so far). I just made a setInterval with callback(collider.update()) with 3ms(perhaps I can set more seconds) delay.
But there is still a performance problem. There is my loop and phaser loop, so I invoke update more, than enough.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.